@json-eval-rs/vanilla 0.0.55 → 0.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-eval-rs/vanilla",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "description": "JSON Eval RS for direct browser usage (vanilla JS) or manual WASM loading (Next.js Turbopack compat)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Get library version (alias)
5
- */
6
- export function version(): string;
7
3
  /**
8
4
  * Get the library version
9
5
  */
10
6
  export function getVersion(): string;
7
+ /**
8
+ * Get library version (alias)
9
+ */
10
+ export function version(): string;
11
11
  /**
12
12
  * Initialize the library (sets up panic hook)
13
13
  */
@@ -250,6 +250,13 @@ export class JSONEvalWasm {
250
250
  * @returns Data in specified format as JavaScript object
251
251
  */
252
252
  getSchemaByPathsJS(paths_json: string, format: number): any;
253
+ /**
254
+ * Get all schema values as array of path-value pairs
255
+ * Returns [{path: "", value: ""}, ...]
256
+ *
257
+ * @returns Array of {path, value} objects as JavaScript array
258
+ */
259
+ getSchemaValueArray(): any;
253
260
  /**
254
261
  * Get the evaluated schema as JavaScript object
255
262
  *
@@ -257,6 +264,13 @@ export class JSONEvalWasm {
257
264
  * @returns Evaluated schema as JavaScript object
258
265
  */
259
266
  getEvaluatedSchemaJS(skip_layout: boolean): any;
267
+ /**
268
+ * Get all schema values as object with dotted path keys
269
+ * Returns {path: value, ...}
270
+ *
271
+ * @returns Flat object with dotted paths as keys
272
+ */
273
+ getSchemaValueObject(): any;
260
274
  /**
261
275
  * Reload schema from ParsedSchemaCache using a cache key
262
276
  *
@@ -368,10 +382,11 @@ export class JSONEvalWasm {
368
382
  */
369
383
  resolveLayoutSubform(subform_path: string, evaluate: boolean): void;
370
384
  /**
371
- * Get schema value from subform (all .value fields)
385
+ * Get schema value from subform in nested object format (all .value fields).
386
+ * Returns a hierarchical object structure mimicking the schema.
372
387
  *
373
388
  * @param subformPath - Path to the subform
374
- * @returns Modified data as JavaScript object
389
+ * @returns Modified data as JavaScript object (Nested)
375
390
  */
376
391
  getSchemaValueSubform(subform_path: string): any;
377
392
  /**
@@ -432,6 +447,14 @@ export class JSONEvalWasm {
432
447
  * @returns Data in specified format as JavaScript object
433
448
  */
434
449
  getSchemaByPathsSubformJS(subform_path: string, paths_json: string, format: number): any;
450
+ /**
451
+ * Get schema values from subform as a flat array of path-value pairs.
452
+ * Returns an array like `[{path: "field.sub", value: 123}, ...]`.
453
+ *
454
+ * @param subformPath - Path to the subform
455
+ * @returns Array of {path, value} objects
456
+ */
457
+ getSchemaValueArraySubform(subform_path: string): any;
435
458
  /**
436
459
  * Get evaluated schema from subform as JavaScript object
437
460
  *
@@ -440,6 +463,14 @@ export class JSONEvalWasm {
440
463
  * @returns Evaluated schema as JavaScript object
441
464
  */
442
465
  getEvaluatedSchemaSubformJS(subform_path: string, resolve_layout: boolean): any;
466
+ /**
467
+ * Get schema values from subform as a flat object with dotted path keys.
468
+ * Returns an object like `{"field.sub": 123, ...}`.
469
+ *
470
+ * @param subformPath - Path to the subform
471
+ * @returns Flat object with dotted paths as keys
472
+ */
473
+ getSchemaValueObjectSubform(subform_path: string): any;
443
474
  /**
444
475
  * Get evaluated schema by specific path from subform
445
476
  *
@@ -570,6 +601,10 @@ export interface InitOutput {
570
601
  readonly jsonevalwasm_getSchemaByPathsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
571
602
  readonly jsonevalwasm_getSchemaByPathsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
572
603
  readonly jsonevalwasm_getSchemaValue: (a: number, b: number) => void;
604
+ readonly jsonevalwasm_getSchemaValueArray: (a: number, b: number) => void;
605
+ readonly jsonevalwasm_getSchemaValueArraySubform: (a: number, b: number, c: number, d: number) => void;
606
+ readonly jsonevalwasm_getSchemaValueObject: (a: number, b: number) => void;
607
+ readonly jsonevalwasm_getSchemaValueObjectSubform: (a: number, b: number, c: number, d: number) => void;
573
608
  readonly jsonevalwasm_getSchemaValueSubform: (a: number, b: number, c: number, d: number) => void;
574
609
  readonly jsonevalwasm_getSubformPaths: (a: number, b: number) => void;
575
610
  readonly jsonevalwasm_hasSubform: (a: number, b: number, c: number) => number;
@@ -149,10 +149,10 @@ function passArrayJsValueToWasm0(array, malloc) {
149
149
  return ptr;
150
150
  }
151
151
  /**
152
- * Get library version (alias)
152
+ * Get the library version
153
153
  * @returns {string}
154
154
  */
155
- export function version() {
155
+ export function getVersion() {
156
156
  let deferred1_0;
157
157
  let deferred1_1;
158
158
  try {
@@ -170,10 +170,10 @@ export function version() {
170
170
  }
171
171
 
172
172
  /**
173
- * Get the library version
173
+ * Get library version (alias)
174
174
  * @returns {string}
175
175
  */
176
- export function getVersion() {
176
+ export function version() {
177
177
  let deferred1_0;
178
178
  let deferred1_1;
179
179
  try {
@@ -1033,6 +1033,28 @@ export class JSONEvalWasm {
1033
1033
  wasm.__wbindgen_add_to_stack_pointer(16);
1034
1034
  }
1035
1035
  }
1036
+ /**
1037
+ * Get all schema values as array of path-value pairs
1038
+ * Returns [{path: "", value: ""}, ...]
1039
+ *
1040
+ * @returns Array of {path, value} objects as JavaScript array
1041
+ * @returns {any}
1042
+ */
1043
+ getSchemaValueArray() {
1044
+ try {
1045
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1046
+ wasm.jsonevalwasm_getSchemaValueArray(retptr, this.__wbg_ptr);
1047
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1048
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1049
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1050
+ if (r2) {
1051
+ throw takeObject(r1);
1052
+ }
1053
+ return takeObject(r0);
1054
+ } finally {
1055
+ wasm.__wbindgen_add_to_stack_pointer(16);
1056
+ }
1057
+ }
1036
1058
  /**
1037
1059
  * Get the evaluated schema as JavaScript object
1038
1060
  *
@@ -1056,6 +1078,28 @@ export class JSONEvalWasm {
1056
1078
  wasm.__wbindgen_add_to_stack_pointer(16);
1057
1079
  }
1058
1080
  }
1081
+ /**
1082
+ * Get all schema values as object with dotted path keys
1083
+ * Returns {path: value, ...}
1084
+ *
1085
+ * @returns Flat object with dotted paths as keys
1086
+ * @returns {any}
1087
+ */
1088
+ getSchemaValueObject() {
1089
+ try {
1090
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1091
+ wasm.jsonevalwasm_getSchemaValueObject(retptr, this.__wbg_ptr);
1092
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1093
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1094
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1095
+ if (r2) {
1096
+ throw takeObject(r1);
1097
+ }
1098
+ return takeObject(r0);
1099
+ } finally {
1100
+ wasm.__wbindgen_add_to_stack_pointer(16);
1101
+ }
1102
+ }
1059
1103
  /**
1060
1104
  * Reload schema from ParsedSchemaCache using a cache key
1061
1105
  *
@@ -1412,10 +1456,11 @@ export class JSONEvalWasm {
1412
1456
  }
1413
1457
  }
1414
1458
  /**
1415
- * Get schema value from subform (all .value fields)
1459
+ * Get schema value from subform in nested object format (all .value fields).
1460
+ * Returns a hierarchical object structure mimicking the schema.
1416
1461
  *
1417
1462
  * @param subformPath - Path to the subform
1418
- * @returns Modified data as JavaScript object
1463
+ * @returns Modified data as JavaScript object (Nested)
1419
1464
  * @param {string} subform_path
1420
1465
  * @returns {any}
1421
1466
  */
@@ -1675,6 +1720,32 @@ export class JSONEvalWasm {
1675
1720
  wasm.__wbindgen_add_to_stack_pointer(16);
1676
1721
  }
1677
1722
  }
1723
+ /**
1724
+ * Get schema values from subform as a flat array of path-value pairs.
1725
+ * Returns an array like `[{path: "field.sub", value: 123}, ...]`.
1726
+ *
1727
+ * @param subformPath - Path to the subform
1728
+ * @returns Array of {path, value} objects
1729
+ * @param {string} subform_path
1730
+ * @returns {any}
1731
+ */
1732
+ getSchemaValueArraySubform(subform_path) {
1733
+ try {
1734
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1735
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1736
+ const len0 = WASM_VECTOR_LEN;
1737
+ wasm.jsonevalwasm_getSchemaValueArraySubform(retptr, this.__wbg_ptr, ptr0, len0);
1738
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1739
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1740
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1741
+ if (r2) {
1742
+ throw takeObject(r1);
1743
+ }
1744
+ return takeObject(r0);
1745
+ } finally {
1746
+ wasm.__wbindgen_add_to_stack_pointer(16);
1747
+ }
1748
+ }
1678
1749
  /**
1679
1750
  * Get evaluated schema from subform as JavaScript object
1680
1751
  *
@@ -1702,6 +1773,32 @@ export class JSONEvalWasm {
1702
1773
  wasm.__wbindgen_add_to_stack_pointer(16);
1703
1774
  }
1704
1775
  }
1776
+ /**
1777
+ * Get schema values from subform as a flat object with dotted path keys.
1778
+ * Returns an object like `{"field.sub": 123, ...}`.
1779
+ *
1780
+ * @param subformPath - Path to the subform
1781
+ * @returns Flat object with dotted paths as keys
1782
+ * @param {string} subform_path
1783
+ * @returns {any}
1784
+ */
1785
+ getSchemaValueObjectSubform(subform_path) {
1786
+ try {
1787
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1788
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1789
+ const len0 = WASM_VECTOR_LEN;
1790
+ wasm.jsonevalwasm_getSchemaValueObjectSubform(retptr, this.__wbg_ptr, ptr0, len0);
1791
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1792
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1793
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1794
+ if (r2) {
1795
+ throw takeObject(r1);
1796
+ }
1797
+ return takeObject(r0);
1798
+ } finally {
1799
+ wasm.__wbindgen_add_to_stack_pointer(16);
1800
+ }
1801
+ }
1705
1802
  /**
1706
1803
  * Get evaluated schema by specific path from subform
1707
1804
  *
@@ -2185,7 +2282,7 @@ function __wbg_get_imports() {
2185
2282
  const ret = getObject(arg0).getTime();
2186
2283
  return ret;
2187
2284
  };
2188
- imports.wbg.__wbg_log_81520727e210fff2 = function(arg0, arg1) {
2285
+ imports.wbg.__wbg_log_2f61091b102ce39d = function(arg0, arg1) {
2189
2286
  console.log(getStringFromWasm0(arg0, arg1));
2190
2287
  };
2191
2288
  imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
Binary file
@@ -47,6 +47,10 @@ export const jsonevalwasm_getSchemaByPathsJS: (a: number, b: number, c: number,
47
47
  export const jsonevalwasm_getSchemaByPathsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
48
48
  export const jsonevalwasm_getSchemaByPathsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
49
49
  export const jsonevalwasm_getSchemaValue: (a: number, b: number) => void;
50
+ export const jsonevalwasm_getSchemaValueArray: (a: number, b: number) => void;
51
+ export const jsonevalwasm_getSchemaValueArraySubform: (a: number, b: number, c: number, d: number) => void;
52
+ export const jsonevalwasm_getSchemaValueObject: (a: number, b: number) => void;
53
+ export const jsonevalwasm_getSchemaValueObjectSubform: (a: number, b: number, c: number, d: number) => void;
50
54
  export const jsonevalwasm_getSchemaValueSubform: (a: number, b: number, c: number, d: number) => void;
51
55
  export const jsonevalwasm_getSubformPaths: (a: number, b: number) => void;
52
56
  export const jsonevalwasm_hasSubform: (a: number, b: number, c: number) => number;