@soda-gql/runtime 0.0.2 → 0.0.4

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/dist/index.cjs CHANGED
@@ -1,22 +1,29 @@
1
1
 
2
- //#region packages/core/src/types/fragment/var-ref.ts
3
- /** Nominal reference used to defer variable binding while carrying type info. */
4
- var VarRef = class VarRef {
5
- constructor(name) {
6
- this.name = name;
2
+ //#region packages/core/src/types/type-foundation/var-ref.ts
3
+ var VarRef = class {
4
+ constructor(inner) {
5
+ this.inner = inner;
7
6
  }
8
- static create(name) {
9
- return new VarRef(name);
7
+ static getInner(varRef) {
8
+ return varRef.inner;
10
9
  }
11
10
  };
11
+ const createVarRefFromVariable = (name) => {
12
+ return new VarRef({
13
+ type: "variable",
14
+ name
15
+ });
16
+ };
12
17
 
13
18
  //#endregion
14
19
  //#region packages/core/src/utils/map-values.ts
15
- const mapValues = (obj, fn) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, fn(value, key)]));
20
+ function mapValues(obj, fn) {
21
+ return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, fn(value, key)]));
22
+ }
16
23
 
17
24
  //#endregion
18
25
  //#region packages/core/src/composer/input.ts
19
- const createVarRefs = (definitions) => mapValues(definitions, (_ref, name) => VarRef.create(name));
26
+ const createVarRefs = (definitions) => mapValues(definitions, (_ref, name) => createVarRefFromVariable(name));
20
27
 
21
28
  //#endregion
22
29
  //#region packages/core/src/types/runtime/projection.ts