From 573cabb1730b6603375b307a1bc4a514808b0c91 Mon Sep 17 00:00:00 2001 From: Pedro Gallardo Date: Fri, 28 Jul 2023 16:52:55 -0300 Subject: [PATCH] fix: ajusta proyecto para ser commonjs --- src/Emulator.ts | 4 ++-- src/index.ts | 2 +- src/utils/createProxy.ts | 10 +++++----- src/utils/findProxy.ts | 4 ++-- src/utils/index.ts | 10 +++++----- src/utils/isTraceable.ts | 2 +- src/utils/map.ts | 2 +- src/utils/traps/apply.ts | 6 +++--- src/utils/traps/construct.ts | 6 +++--- src/utils/traps/deleteProperty.ts | 4 ++-- src/utils/traps/get.ts | 8 ++++---- src/utils/traps/index.ts | 10 +++++----- src/utils/traps/set.ts | 8 ++++---- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Emulator.ts b/src/Emulator.ts index e6a870c..4a12fd4 100755 --- a/src/Emulator.ts +++ b/src/Emulator.ts @@ -1,5 +1,5 @@ -import Exotic from "./types/Exotic.js"; -import { findProxy, map, createProxy } from "./utils/index"; +import Exotic from "./types/Exotic"; +import { findProxy, map, createProxy } from "./utils"; import { EventEmitter } from "events"; export default class Emulator extends EventEmitter implements Exotic.Emulator { diff --git a/src/index.ts b/src/index.ts index 6682917..98ad89b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ -import Emulator from "./Emulator.js"; +import Emulator from "./Emulator"; export default Emulator; diff --git a/src/utils/createProxy.ts b/src/utils/createProxy.ts index f46ac54..da5fcfd 100644 --- a/src/utils/createProxy.ts +++ b/src/utils/createProxy.ts @@ -1,8 +1,8 @@ -import Exotic from "../types/Exotic.js"; -import map from "./map.js"; -import findProxy from "./findProxy.js"; -import isTraceable from "./isTraceable.js"; -import * as traps from "./traps/index.js"; +import Exotic from "../types/Exotic"; +import map from "./map"; +import findProxy from "./findProxy"; +import isTraceable from "./isTraceable"; +import * as traps from "./traps"; const createProxy = ( scope: Exotic.Emulator, diff --git a/src/utils/findProxy.ts b/src/utils/findProxy.ts index 5e78724..76e077d 100644 --- a/src/utils/findProxy.ts +++ b/src/utils/findProxy.ts @@ -1,5 +1,5 @@ -import Exotic from "../types/Exotic.js"; -import map from "./map.js"; +import Exotic from "../types/Exotic"; +import map from "./map"; const find = (value: any): Exotic.Proxy | null => { if (map.proxies.has(value)) return value; // value is already a proxy diff --git a/src/utils/index.ts b/src/utils/index.ts index 3121340..1ac6227 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,7 +1,7 @@ -import isTraceable from "./isTraceable.js"; -import findProxy from "./findProxy.js"; -import createProxy from "./createProxy.js"; -import map from "./map.js"; -import * as traps from "./traps/index.js"; +import isTraceable from "./isTraceable"; +import findProxy from "./findProxy"; +import createProxy from "./createProxy"; +import map from "./map"; +import * as traps from "./traps"; export { isTraceable, findProxy, map, createProxy, traps }; diff --git a/src/utils/isTraceable.ts b/src/utils/isTraceable.ts index b8c13a5..319b0dd 100644 --- a/src/utils/isTraceable.ts +++ b/src/utils/isTraceable.ts @@ -1,4 +1,4 @@ -import find from "./findProxy.js"; +import find from "./findProxy"; const isTraceable = (value: any): boolean => { const isObject = typeof value === "object"; diff --git a/src/utils/map.ts b/src/utils/map.ts index a1a423d..b4ac3b0 100644 --- a/src/utils/map.ts +++ b/src/utils/map.ts @@ -1,4 +1,4 @@ -import Exotic from "../types/Exotic.js"; +import Exotic from "../types/Exotic"; const emulators = new WeakMap(); const dummies = new WeakMap(); diff --git a/src/utils/traps/apply.ts b/src/utils/traps/apply.ts index 834f562..c43e8f4 100644 --- a/src/utils/traps/apply.ts +++ b/src/utils/traps/apply.ts @@ -1,6 +1,6 @@ -import Exotic from "../../types/Exotic.js"; -import createProxy from "../createProxy.js"; -import map from "../map.js"; +import Exotic from "../../types/Exotic"; +import createProxy from "../createProxy"; +import map from "../map"; const apply = ( dummy: Exotic.FunctionLike, diff --git a/src/utils/traps/construct.ts b/src/utils/traps/construct.ts index ea1db25..14ce5ca 100644 --- a/src/utils/traps/construct.ts +++ b/src/utils/traps/construct.ts @@ -1,6 +1,6 @@ -import Exotic from "../../types/Exotic.js"; -import createProxy from "../createProxy.js"; -import map from "../map.js"; +import Exotic from "../../types/Exotic"; +import createProxy from "../createProxy"; +import map from "../map"; const construct = (dummy: Exotic.FunctionLike, args: unknown[]): object => { const item = map.dummies.get(dummy); diff --git a/src/utils/traps/deleteProperty.ts b/src/utils/traps/deleteProperty.ts index e74906b..ce85d59 100644 --- a/src/utils/traps/deleteProperty.ts +++ b/src/utils/traps/deleteProperty.ts @@ -1,5 +1,5 @@ -import Exotic from "../../types/Exotic.js"; -import map from "../map.js"; +import Exotic from "../../types/Exotic"; +import map from "../map"; const deleteProperty = (dummy: Exotic.FunctionLike, key: string): boolean => { const item = map.dummies.get(dummy); diff --git a/src/utils/traps/get.ts b/src/utils/traps/get.ts index 8c6c82a..471661d 100644 --- a/src/utils/traps/get.ts +++ b/src/utils/traps/get.ts @@ -1,7 +1,7 @@ -import Exotic from "../../types/Exotic.js"; -import createProxy from "../createProxy.js"; -import isTraceable from "../isTraceable.js"; -import map from "../map.js"; +import Exotic from "../../types/Exotic"; +import createProxy from "../createProxy"; +import isTraceable from "../isTraceable"; +import map from "../map"; const get = (dummy: Exotic.FunctionLike, key: string): unknown => { const item = map.dummies.get(dummy); diff --git a/src/utils/traps/index.ts b/src/utils/traps/index.ts index db4759c..02842d6 100644 --- a/src/utils/traps/index.ts +++ b/src/utils/traps/index.ts @@ -1,7 +1,7 @@ -import get from "./get.js"; -import set from "./set.js"; -import deleteProperty from "./deleteProperty.js"; -import construct from "./construct.js"; -import apply from "./apply.js"; +import get from "./get"; +import set from "./set"; +import deleteProperty from "./deleteProperty"; +import construct from "./construct"; +import apply from "./apply"; export { get, set, deleteProperty, construct, apply }; diff --git a/src/utils/traps/set.ts b/src/utils/traps/set.ts index c139bf7..57d6d9e 100644 --- a/src/utils/traps/set.ts +++ b/src/utils/traps/set.ts @@ -1,7 +1,7 @@ -import Exotic from "../../types/Exotic.js"; -import createProxy from "../createProxy.js"; -import isTraceable from "../isTraceable.js"; -import map from "../map.js"; +import Exotic from "../../types/Exotic"; +import createProxy from "../createProxy"; +import isTraceable from "../isTraceable"; +import map from "../map"; const set = ( dummy: Exotic.FunctionLike,