@gershy/util-jsfn-encode 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cmp/cjs/main.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import '@gershy/clearing';
2
2
  export type JsImport = {
3
- varDef: null | string;
4
3
  importPath: string;
4
+ varDef: null | string;
5
5
  };
6
6
  export type SovereignFn = (...args: any) => any;
7
7
  export type JsfnInst<Cls extends abstract new (...args: Jsfn[]) => any> = {
package/cmp/cjs/main.js CHANGED
@@ -37,9 +37,9 @@ var main_default = (args) => {
37
37
  }
38
38
  if (cl.inCls(val?.toJsfn, Function)) {
39
39
  const { args: args2, hoist } = val;
40
- const [importPath, clsName] = hoist.split("::");
41
- jsImports.push({ varDef: clsName, importPath });
42
- return `new ${clsName}(${args2.map((a) => serialize(a)).join(",")})`;
40
+ const [importPath, varDef] = hoist.split("::");
41
+ jsImports.push({ importPath, varDef });
42
+ return `new ${varDef.replace(/[{}]/g, "").trim()}(${args2.map((a) => serialize(a)).join(",")})`;
43
43
  }
44
44
  return JSON.stringify(val);
45
45
  };
package/cmp/esm/main.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import '@gershy/clearing';
2
2
  export type JsImport = {
3
- varDef: null | string;
4
3
  importPath: string;
4
+ varDef: null | string;
5
5
  };
6
6
  export type SovereignFn = (...args: any) => any;
7
7
  export type JsfnInst<Cls extends abstract new (...args: Jsfn[]) => any> = {
package/cmp/esm/main.js CHANGED
@@ -14,9 +14,9 @@ var main_default = (args) => {
14
14
  }
15
15
  if (cl.inCls(val?.toJsfn, Function)) {
16
16
  const { args: args2, hoist } = val;
17
- const [importPath, clsName] = hoist.split("::");
18
- jsImports.push({ varDef: clsName, importPath });
19
- return `new ${clsName}(${args2.map((a) => serialize(a)).join(",")})`;
17
+ const [importPath, varDef] = hoist.split("::");
18
+ jsImports.push({ importPath, varDef });
19
+ return `new ${varDef.replace(/[{}]/g, "").trim()}(${args2.map((a) => serialize(a)).join(",")})`;
20
20
  }
21
21
  return JSON.stringify(val);
22
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gershy/util-jsfn-encode",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "author": "Gershom Maes",
5
5
  "description": "TODO",
6
6
  "keywords": [