@json-eval-rs/vanilla 0.0.45

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.
@@ -0,0 +1,2382 @@
1
+ let wasm;
2
+
3
+ let cachedUint8ArrayMemory0 = null;
4
+
5
+ function getUint8ArrayMemory0() {
6
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
+ }
9
+ return cachedUint8ArrayMemory0;
10
+ }
11
+
12
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
13
+
14
+ cachedTextDecoder.decode();
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
33
+ let heap = new Array(128).fill(undefined);
34
+
35
+ heap.push(undefined, null, true, false);
36
+
37
+ let heap_next = heap.length;
38
+
39
+ function addHeapObject(obj) {
40
+ if (heap_next === heap.length) heap.push(heap.length + 1);
41
+ const idx = heap_next;
42
+ heap_next = heap[idx];
43
+
44
+ heap[idx] = obj;
45
+ return idx;
46
+ }
47
+
48
+ function getObject(idx) { return heap[idx]; }
49
+
50
+ let WASM_VECTOR_LEN = 0;
51
+
52
+ const cachedTextEncoder = new TextEncoder();
53
+
54
+ if (!('encodeInto' in cachedTextEncoder)) {
55
+ cachedTextEncoder.encodeInto = function (arg, view) {
56
+ const buf = cachedTextEncoder.encode(arg);
57
+ view.set(buf);
58
+ return {
59
+ read: arg.length,
60
+ written: buf.length
61
+ };
62
+ }
63
+ }
64
+
65
+ function passStringToWasm0(arg, malloc, realloc) {
66
+
67
+ if (realloc === undefined) {
68
+ const buf = cachedTextEncoder.encode(arg);
69
+ const ptr = malloc(buf.length, 1) >>> 0;
70
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
71
+ WASM_VECTOR_LEN = buf.length;
72
+ return ptr;
73
+ }
74
+
75
+ let len = arg.length;
76
+ let ptr = malloc(len, 1) >>> 0;
77
+
78
+ const mem = getUint8ArrayMemory0();
79
+
80
+ let offset = 0;
81
+
82
+ for (; offset < len; offset++) {
83
+ const code = arg.charCodeAt(offset);
84
+ if (code > 0x7F) break;
85
+ mem[ptr + offset] = code;
86
+ }
87
+
88
+ if (offset !== len) {
89
+ if (offset !== 0) {
90
+ arg = arg.slice(offset);
91
+ }
92
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
93
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
94
+ const ret = cachedTextEncoder.encodeInto(arg, view);
95
+
96
+ offset += ret.written;
97
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
98
+ }
99
+
100
+ WASM_VECTOR_LEN = offset;
101
+ return ptr;
102
+ }
103
+
104
+ let cachedDataViewMemory0 = null;
105
+
106
+ function getDataViewMemory0() {
107
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
108
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
109
+ }
110
+ return cachedDataViewMemory0;
111
+ }
112
+
113
+ function getArrayU8FromWasm0(ptr, len) {
114
+ ptr = ptr >>> 0;
115
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
116
+ }
117
+
118
+ function handleError(f, args) {
119
+ try {
120
+ return f.apply(this, args);
121
+ } catch (e) {
122
+ wasm.__wbindgen_export_3(addHeapObject(e));
123
+ }
124
+ }
125
+
126
+ function dropObject(idx) {
127
+ if (idx < 132) return;
128
+ heap[idx] = heap_next;
129
+ heap_next = idx;
130
+ }
131
+
132
+ function takeObject(idx) {
133
+ const ret = getObject(idx);
134
+ dropObject(idx);
135
+ return ret;
136
+ }
137
+
138
+ function debugString(val) {
139
+ // primitive types
140
+ const type = typeof val;
141
+ if (type == 'number' || type == 'boolean' || val == null) {
142
+ return `${val}`;
143
+ }
144
+ if (type == 'string') {
145
+ return `"${val}"`;
146
+ }
147
+ if (type == 'symbol') {
148
+ const description = val.description;
149
+ if (description == null) {
150
+ return 'Symbol';
151
+ } else {
152
+ return `Symbol(${description})`;
153
+ }
154
+ }
155
+ if (type == 'function') {
156
+ const name = val.name;
157
+ if (typeof name == 'string' && name.length > 0) {
158
+ return `Function(${name})`;
159
+ } else {
160
+ return 'Function';
161
+ }
162
+ }
163
+ // objects
164
+ if (Array.isArray(val)) {
165
+ const length = val.length;
166
+ let debug = '[';
167
+ if (length > 0) {
168
+ debug += debugString(val[0]);
169
+ }
170
+ for(let i = 1; i < length; i++) {
171
+ debug += ', ' + debugString(val[i]);
172
+ }
173
+ debug += ']';
174
+ return debug;
175
+ }
176
+ // Test for built-in
177
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
178
+ let className;
179
+ if (builtInMatches && builtInMatches.length > 1) {
180
+ className = builtInMatches[1];
181
+ } else {
182
+ // Failed to match the standard '[object ClassName]'
183
+ return toString.call(val);
184
+ }
185
+ if (className == 'Object') {
186
+ // we're a user defined class or Object
187
+ // JSON.stringify avoids problems with cycles, and is generally much
188
+ // easier than looping through ownProperties of `val`.
189
+ try {
190
+ return 'Object(' + JSON.stringify(val) + ')';
191
+ } catch (_) {
192
+ return 'Object';
193
+ }
194
+ }
195
+ // errors
196
+ if (val instanceof Error) {
197
+ return `${val.name}: ${val.message}\n${val.stack}`;
198
+ }
199
+ // TODO we could test for more things here, like `Set`s and `Map`s.
200
+ return className;
201
+ }
202
+
203
+ function isLikeNone(x) {
204
+ return x === undefined || x === null;
205
+ }
206
+
207
+ function passArrayJsValueToWasm0(array, malloc) {
208
+ const ptr = malloc(array.length * 4, 4) >>> 0;
209
+ const mem = getDataViewMemory0();
210
+ for (let i = 0; i < array.length; i++) {
211
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
212
+ }
213
+ WASM_VECTOR_LEN = array.length;
214
+ return ptr;
215
+ }
216
+ /**
217
+ * Get library version (alias)
218
+ * @returns {string}
219
+ */
220
+ export function version() {
221
+ let deferred1_0;
222
+ let deferred1_1;
223
+ try {
224
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
225
+ wasm.getVersion(retptr);
226
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
227
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
228
+ deferred1_0 = r0;
229
+ deferred1_1 = r1;
230
+ return getStringFromWasm0(r0, r1);
231
+ } finally {
232
+ wasm.__wbindgen_add_to_stack_pointer(16);
233
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Initialize the library (sets up panic hook)
239
+ */
240
+ export function init() {
241
+ wasm.init();
242
+ }
243
+
244
+ /**
245
+ * Get the library version
246
+ * @returns {string}
247
+ */
248
+ export function getVersion() {
249
+ let deferred1_0;
250
+ let deferred1_1;
251
+ try {
252
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
253
+ wasm.getVersion(retptr);
254
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
255
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
256
+ deferred1_0 = r0;
257
+ deferred1_1 = r1;
258
+ return getStringFromWasm0(r0, r1);
259
+ } finally {
260
+ wasm.__wbindgen_add_to_stack_pointer(16);
261
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
262
+ }
263
+ }
264
+
265
+ function passArray8ToWasm0(arg, malloc) {
266
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
267
+ getUint8ArrayMemory0().set(arg, ptr / 1);
268
+ WASM_VECTOR_LEN = arg.length;
269
+ return ptr;
270
+ }
271
+
272
+ function getArrayJsValueFromWasm0(ptr, len) {
273
+ ptr = ptr >>> 0;
274
+ const mem = getDataViewMemory0();
275
+ const result = [];
276
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
277
+ result.push(takeObject(mem.getUint32(i, true)));
278
+ }
279
+ return result;
280
+ }
281
+
282
+ const JSONEvalWasmFinalization = (typeof FinalizationRegistry === 'undefined')
283
+ ? { register: () => {}, unregister: () => {} }
284
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsonevalwasm_free(ptr >>> 0, 1));
285
+ /**
286
+ * WebAssembly wrapper for JSONEval
287
+ */
288
+ export class JSONEvalWasm {
289
+
290
+ static __wrap(ptr) {
291
+ ptr = ptr >>> 0;
292
+ const obj = Object.create(JSONEvalWasm.prototype);
293
+ obj.__wbg_ptr = ptr;
294
+ JSONEvalWasmFinalization.register(obj, obj.__wbg_ptr, obj);
295
+ return obj;
296
+ }
297
+
298
+ __destroy_into_raw() {
299
+ const ptr = this.__wbg_ptr;
300
+ this.__wbg_ptr = 0;
301
+ JSONEvalWasmFinalization.unregister(this);
302
+ return ptr;
303
+ }
304
+
305
+ free() {
306
+ const ptr = this.__destroy_into_raw();
307
+ wasm.__wbg_jsonevalwasm_free(ptr, 0);
308
+ }
309
+ /**
310
+ * Evaluate and return as JsValue for direct JavaScript object access
311
+ *
312
+ * @param data - JSON data string
313
+ * @param context - Optional context data JSON string
314
+ * @returns Evaluated schema as JavaScript object
315
+ * @param {string} data
316
+ * @param {string | null} [context]
317
+ * @param {string[] | null} [paths]
318
+ * @returns {any}
319
+ */
320
+ evaluateJS(data, context, paths) {
321
+ try {
322
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
323
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
324
+ const len0 = WASM_VECTOR_LEN;
325
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
326
+ var len1 = WASM_VECTOR_LEN;
327
+ var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
328
+ var len2 = WASM_VECTOR_LEN;
329
+ wasm.jsonevalwasm_evaluateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
330
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
331
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
332
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
333
+ if (r2) {
334
+ throw takeObject(r1);
335
+ }
336
+ return takeObject(r0);
337
+ } finally {
338
+ wasm.__wbindgen_add_to_stack_pointer(16);
339
+ }
340
+ }
341
+ /**
342
+ * Compile JSON logic and return a global ID
343
+ * @param logic_str - JSON logic expression as a string
344
+ * @returns Compiled logic ID as number (u64)
345
+ * @param {string} logic_str
346
+ * @returns {number}
347
+ */
348
+ compileLogic(logic_str) {
349
+ try {
350
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
351
+ const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
352
+ const len0 = WASM_VECTOR_LEN;
353
+ wasm.jsonevalwasm_compileLogic(retptr, this.__wbg_ptr, ptr0, len0);
354
+ var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
355
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
356
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
357
+ if (r3) {
358
+ throw takeObject(r2);
359
+ }
360
+ return r0;
361
+ } finally {
362
+ wasm.__wbindgen_add_to_stack_pointer(16);
363
+ }
364
+ }
365
+ /**
366
+ * Evaluate dependents when a field changes (returns array of changes as JSON string)
367
+ *
368
+ * @param changedPath - Path of the field that changed
369
+ * @param data - Optional updated JSON data string
370
+ * @param context - Optional context data JSON string
371
+ * @returns Array of dependent change objects as JSON string
372
+ * @param {string} changed_path
373
+ * @param {string | null} [data]
374
+ * @param {string | null} [context]
375
+ * @returns {string}
376
+ */
377
+ evaluateDependents(changed_path, data, context) {
378
+ let deferred5_0;
379
+ let deferred5_1;
380
+ try {
381
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
382
+ const ptr0 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
383
+ const len0 = WASM_VECTOR_LEN;
384
+ var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
385
+ var len1 = WASM_VECTOR_LEN;
386
+ var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
387
+ var len2 = WASM_VECTOR_LEN;
388
+ wasm.jsonevalwasm_evaluateDependents(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
389
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
390
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
391
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
392
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
393
+ var ptr4 = r0;
394
+ var len4 = r1;
395
+ if (r3) {
396
+ ptr4 = 0; len4 = 0;
397
+ throw takeObject(r2);
398
+ }
399
+ deferred5_0 = ptr4;
400
+ deferred5_1 = len4;
401
+ return getStringFromWasm0(ptr4, len4);
402
+ } finally {
403
+ wasm.__wbindgen_add_to_stack_pointer(16);
404
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
405
+ }
406
+ }
407
+ /**
408
+ * Compile and run JSON logic from a JSON logic string
409
+ * @param logic_str - JSON logic expression as a string
410
+ * @param data - Optional JSON data string
411
+ * @param context - Optional JSON context string
412
+ * @returns Result as JavaScript object
413
+ * @param {string} logic_str
414
+ * @param {string | null} [data]
415
+ * @param {string | null} [context]
416
+ * @returns {any}
417
+ */
418
+ compileAndRunLogic(logic_str, data, context) {
419
+ try {
420
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
421
+ const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
422
+ const len0 = WASM_VECTOR_LEN;
423
+ var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
424
+ var len1 = WASM_VECTOR_LEN;
425
+ var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
426
+ var len2 = WASM_VECTOR_LEN;
427
+ wasm.jsonevalwasm_compileAndRunLogic(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
428
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
429
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
430
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
431
+ if (r2) {
432
+ throw takeObject(r1);
433
+ }
434
+ return takeObject(r0);
435
+ } finally {
436
+ wasm.__wbindgen_add_to_stack_pointer(16);
437
+ }
438
+ }
439
+ /**
440
+ * Evaluate dependents and return as JavaScript object
441
+ *
442
+ * @param changedPathsJson - JSON array of field paths that changed
443
+ * @param data - Optional updated JSON data string
444
+ * @param context - Optional context data JSON string
445
+ * @param reEvaluate - If true, performs full evaluation after processing dependents
446
+ * @returns Array of dependent change objects as JavaScript object
447
+ * @param {string} changed_paths_json
448
+ * @param {string | null | undefined} data
449
+ * @param {string | null | undefined} context
450
+ * @param {boolean} re_evaluate
451
+ * @returns {any}
452
+ */
453
+ evaluateDependentsJS(changed_paths_json, data, context, re_evaluate) {
454
+ try {
455
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
456
+ const ptr0 = passStringToWasm0(changed_paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
457
+ const len0 = WASM_VECTOR_LEN;
458
+ var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
459
+ var len1 = WASM_VECTOR_LEN;
460
+ var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
461
+ var len2 = WASM_VECTOR_LEN;
462
+ wasm.jsonevalwasm_evaluateDependentsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, re_evaluate);
463
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
464
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
465
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
466
+ if (r2) {
467
+ throw takeObject(r1);
468
+ }
469
+ return takeObject(r0);
470
+ } finally {
471
+ wasm.__wbindgen_add_to_stack_pointer(16);
472
+ }
473
+ }
474
+ /**
475
+ * Evaluate schema with provided data (does not return schema - use getEvaluatedSchema() for that)
476
+ *
477
+ * @param data - JSON data string
478
+ * @param context - Optional context data JSON string
479
+ * @throws Error if evaluation fails
480
+ * @param {string} data
481
+ * @param {string | null} [context]
482
+ * @param {string[] | null} [paths]
483
+ */
484
+ evaluate(data, context, paths) {
485
+ try {
486
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
487
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
488
+ const len0 = WASM_VECTOR_LEN;
489
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
490
+ var len1 = WASM_VECTOR_LEN;
491
+ var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
492
+ var len2 = WASM_VECTOR_LEN;
493
+ wasm.jsonevalwasm_evaluate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
494
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
495
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
496
+ if (r1) {
497
+ throw takeObject(r0);
498
+ }
499
+ } finally {
500
+ wasm.__wbindgen_add_to_stack_pointer(16);
501
+ }
502
+ }
503
+ /**
504
+ * Run pre-compiled logic by ID
505
+ * @param logic_id - Compiled logic ID from compileLogic
506
+ * @param data - Optional JSON data string
507
+ * @param context - Optional JSON context string
508
+ * @returns Result as JavaScript object
509
+ * @param {number} logic_id
510
+ * @param {string | null} [data]
511
+ * @param {string | null} [context]
512
+ * @returns {any}
513
+ */
514
+ runLogic(logic_id, data, context) {
515
+ try {
516
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
517
+ var ptr0 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
518
+ var len0 = WASM_VECTOR_LEN;
519
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
520
+ var len1 = WASM_VECTOR_LEN;
521
+ wasm.jsonevalwasm_runLogic(retptr, this.__wbg_ptr, logic_id, ptr0, len0, ptr1, len1);
522
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
523
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
524
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
525
+ if (r2) {
526
+ throw takeObject(r1);
527
+ }
528
+ return takeObject(r0);
529
+ } finally {
530
+ wasm.__wbindgen_add_to_stack_pointer(16);
531
+ }
532
+ }
533
+ /**
534
+ * Validate data and return as plain JavaScript object (Worker-safe)
535
+ *
536
+ * @param data - JSON data string
537
+ * @param context - Optional context data JSON string
538
+ * @returns Plain JavaScript object with validation result
539
+ * @param {string} data
540
+ * @param {string | null} [context]
541
+ * @returns {any}
542
+ */
543
+ validateJS(data, context) {
544
+ try {
545
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
546
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
547
+ const len0 = WASM_VECTOR_LEN;
548
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
549
+ var len1 = WASM_VECTOR_LEN;
550
+ wasm.jsonevalwasm_validateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
551
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
552
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
553
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
554
+ if (r2) {
555
+ throw takeObject(r1);
556
+ }
557
+ return takeObject(r0);
558
+ } finally {
559
+ wasm.__wbindgen_add_to_stack_pointer(16);
560
+ }
561
+ }
562
+ /**
563
+ * Validate data against schema rules with optional path filtering
564
+ *
565
+ * @param data - JSON data string
566
+ * @param context - Optional context data JSON string
567
+ * @param paths - Optional array of paths to validate (null for all)
568
+ * @returns ValidationResult
569
+ * @param {string} data
570
+ * @param {string | null} [context]
571
+ * @param {string[] | null} [paths]
572
+ * @returns {ValidationResult}
573
+ */
574
+ validatePaths(data, context, paths) {
575
+ try {
576
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
577
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
578
+ const len0 = WASM_VECTOR_LEN;
579
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
580
+ var len1 = WASM_VECTOR_LEN;
581
+ var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
582
+ var len2 = WASM_VECTOR_LEN;
583
+ wasm.jsonevalwasm_validatePaths(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
584
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
585
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
586
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
587
+ if (r2) {
588
+ throw takeObject(r1);
589
+ }
590
+ return ValidationResult.__wrap(r0);
591
+ } finally {
592
+ wasm.__wbindgen_add_to_stack_pointer(16);
593
+ }
594
+ }
595
+ /**
596
+ * Validate with path filtering and return as plain JavaScript object (Worker-safe)
597
+ *
598
+ * @param data - JSON data string
599
+ * @param context - Optional context data JSON string
600
+ * @param paths - Optional array of paths to validate (null for all)
601
+ * @returns Plain JavaScript object with validation result
602
+ * @param {string} data
603
+ * @param {string | null} [context]
604
+ * @param {string[] | null} [paths]
605
+ * @returns {any}
606
+ */
607
+ validatePathsJS(data, context, paths) {
608
+ try {
609
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
610
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
611
+ const len0 = WASM_VECTOR_LEN;
612
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
613
+ var len1 = WASM_VECTOR_LEN;
614
+ var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
615
+ var len2 = WASM_VECTOR_LEN;
616
+ wasm.jsonevalwasm_validatePathsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
617
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
618
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
619
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
620
+ if (r2) {
621
+ throw takeObject(r1);
622
+ }
623
+ return takeObject(r0);
624
+ } finally {
625
+ wasm.__wbindgen_add_to_stack_pointer(16);
626
+ }
627
+ }
628
+ /**
629
+ * Validate data against schema rules
630
+ *
631
+ * @param data - JSON data string
632
+ * @param context - Optional context data JSON string
633
+ * @returns ValidationResult
634
+ * @param {string} data
635
+ * @param {string | null} [context]
636
+ * @returns {ValidationResult}
637
+ */
638
+ validate(data, context) {
639
+ try {
640
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
641
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
642
+ const len0 = WASM_VECTOR_LEN;
643
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
644
+ var len1 = WASM_VECTOR_LEN;
645
+ wasm.jsonevalwasm_validate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
646
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
647
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
648
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
649
+ if (r2) {
650
+ throw takeObject(r1);
651
+ }
652
+ return ValidationResult.__wrap(r0);
653
+ } finally {
654
+ wasm.__wbindgen_add_to_stack_pointer(16);
655
+ }
656
+ }
657
+ /**
658
+ * Create a new JSONEval instance from a cached ParsedSchema
659
+ *
660
+ * @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
661
+ * @param context - Optional context data JSON string
662
+ * @param data - Optional initial data JSON string
663
+ * @param {string} cache_key
664
+ * @param {string | null} [context]
665
+ * @param {string | null} [data]
666
+ * @returns {JSONEvalWasm}
667
+ */
668
+ static newFromCache(cache_key, context, data) {
669
+ try {
670
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
671
+ const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
672
+ const len0 = WASM_VECTOR_LEN;
673
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
674
+ var len1 = WASM_VECTOR_LEN;
675
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
676
+ var len2 = WASM_VECTOR_LEN;
677
+ wasm.jsonevalwasm_newFromCache(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
678
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
679
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
680
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
681
+ if (r2) {
682
+ throw takeObject(r1);
683
+ }
684
+ return JSONEvalWasm.__wrap(r0);
685
+ } finally {
686
+ wasm.__wbindgen_add_to_stack_pointer(16);
687
+ }
688
+ }
689
+ /**
690
+ * Create a new JSONEval instance from MessagePack-encoded schema
691
+ *
692
+ * @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
693
+ * @param context - Optional context data JSON string
694
+ * @param data - Optional initial data JSON string
695
+ * @param {Uint8Array} schema_msgpack
696
+ * @param {string | null} [context]
697
+ * @param {string | null} [data]
698
+ * @returns {JSONEvalWasm}
699
+ */
700
+ static newFromMsgpack(schema_msgpack, context, data) {
701
+ try {
702
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
703
+ const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export_0);
704
+ const len0 = WASM_VECTOR_LEN;
705
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
706
+ var len1 = WASM_VECTOR_LEN;
707
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
708
+ var len2 = WASM_VECTOR_LEN;
709
+ wasm.jsonevalwasm_newFromMsgpack(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
710
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
711
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
712
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
713
+ if (r2) {
714
+ throw takeObject(r1);
715
+ }
716
+ return JSONEvalWasm.__wrap(r0);
717
+ } finally {
718
+ wasm.__wbindgen_add_to_stack_pointer(16);
719
+ }
720
+ }
721
+ /**
722
+ * Set timezone offset for datetime operations (TODAY, NOW)
723
+ *
724
+ * @param offsetMinutes - Timezone offset in minutes from UTC (e.g., 420 for UTC+7, -300 for UTC-5)
725
+ * Pass null or undefined to reset to UTC
726
+ * @param {number | null} [offset_minutes]
727
+ */
728
+ setTimezoneOffset(offset_minutes) {
729
+ wasm.jsonevalwasm_setTimezoneOffset(this.__wbg_ptr, isLikeNone(offset_minutes) ? 0x100000001 : (offset_minutes) >> 0);
730
+ }
731
+ /**
732
+ * Create a new JSONEval instance
733
+ *
734
+ * @param schema - JSON schema string
735
+ * @param context - Optional context data JSON string
736
+ * @param data - Optional initial data JSON string
737
+ * @param {string} schema
738
+ * @param {string | null} [context]
739
+ * @param {string | null} [data]
740
+ */
741
+ constructor(schema, context, data) {
742
+ try {
743
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
744
+ const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
745
+ const len0 = WASM_VECTOR_LEN;
746
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
747
+ var len1 = WASM_VECTOR_LEN;
748
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
749
+ var len2 = WASM_VECTOR_LEN;
750
+ wasm.jsonevalwasm_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
751
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
752
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
753
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
754
+ if (r2) {
755
+ throw takeObject(r1);
756
+ }
757
+ this.__wbg_ptr = r0 >>> 0;
758
+ JSONEvalWasmFinalization.register(this, this.__wbg_ptr, this);
759
+ return this;
760
+ } finally {
761
+ wasm.__wbindgen_add_to_stack_pointer(16);
762
+ }
763
+ }
764
+ /**
765
+ * Get cache statistics
766
+ *
767
+ * @returns Cache statistics as JavaScript object with hits, misses, and entries
768
+ * @returns {any}
769
+ */
770
+ cacheStats() {
771
+ try {
772
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
773
+ wasm.jsonevalwasm_cacheStats(retptr, this.__wbg_ptr);
774
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
775
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
776
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
777
+ if (r2) {
778
+ throw takeObject(r1);
779
+ }
780
+ return takeObject(r0);
781
+ } finally {
782
+ wasm.__wbindgen_add_to_stack_pointer(16);
783
+ }
784
+ }
785
+ /**
786
+ * Clear the evaluation cache
787
+ */
788
+ clearCache() {
789
+ wasm.jsonevalwasm_clearCache(this.__wbg_ptr);
790
+ }
791
+ /**
792
+ * Enable evaluation caching
793
+ * Useful for reusing JSONEval instances with different data
794
+ */
795
+ enableCache() {
796
+ wasm.jsonevalwasm_enableCache(this.__wbg_ptr);
797
+ }
798
+ /**
799
+ * Disable evaluation caching
800
+ * Useful for web API usage where each request creates a new JSONEval instance
801
+ * Improves performance by skipping cache operations that have no benefit for single-use instances
802
+ */
803
+ disableCache() {
804
+ wasm.jsonevalwasm_disableCache(this.__wbg_ptr);
805
+ }
806
+ /**
807
+ * Check if evaluation caching is enabled
808
+ *
809
+ * @returns true if caching is enabled, false otherwise
810
+ * @returns {boolean}
811
+ */
812
+ isCacheEnabled() {
813
+ const ret = wasm.jsonevalwasm_isCacheEnabled(this.__wbg_ptr);
814
+ return ret !== 0;
815
+ }
816
+ /**
817
+ * Get the number of cached entries
818
+ *
819
+ * @returns Number of cached entries
820
+ * @returns {number}
821
+ */
822
+ cacheLen() {
823
+ const ret = wasm.jsonevalwasm_cacheLen(this.__wbg_ptr);
824
+ return ret >>> 0;
825
+ }
826
+ /**
827
+ * Resolve layout with optional evaluation
828
+ *
829
+ * @param evaluate - If true, runs evaluation before resolving layout
830
+ * @throws Error if resolve fails
831
+ * @param {boolean} evaluate
832
+ */
833
+ resolveLayout(evaluate) {
834
+ try {
835
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
836
+ wasm.jsonevalwasm_resolveLayout(retptr, this.__wbg_ptr, evaluate);
837
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
838
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
839
+ if (r1) {
840
+ throw takeObject(r0);
841
+ }
842
+ } finally {
843
+ wasm.__wbindgen_add_to_stack_pointer(16);
844
+ }
845
+ }
846
+ /**
847
+ * Reload schema with new data
848
+ *
849
+ * @param schema - New JSON schema string
850
+ * @param context - Optional context data JSON string
851
+ * @param data - Optional initial data JSON string
852
+ * @param {string} schema
853
+ * @param {string | null} [context]
854
+ * @param {string | null} [data]
855
+ */
856
+ reloadSchema(schema, context, data) {
857
+ try {
858
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
859
+ const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
860
+ const len0 = WASM_VECTOR_LEN;
861
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
862
+ var len1 = WASM_VECTOR_LEN;
863
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
864
+ var len2 = WASM_VECTOR_LEN;
865
+ wasm.jsonevalwasm_reloadSchema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
868
+ if (r1) {
869
+ throw takeObject(r0);
870
+ }
871
+ } finally {
872
+ wasm.__wbindgen_add_to_stack_pointer(16);
873
+ }
874
+ }
875
+ /**
876
+ * Get all schema values (evaluations ending with .value)
877
+ * Mutates internal data by overriding with values from value evaluations
878
+ *
879
+ * @returns Modified data as JavaScript object
880
+ * @returns {any}
881
+ */
882
+ getSchemaValue() {
883
+ try {
884
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
885
+ wasm.jsonevalwasm_getSchemaValue(retptr, this.__wbg_ptr);
886
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
887
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
888
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
889
+ if (r2) {
890
+ throw takeObject(r1);
891
+ }
892
+ return takeObject(r0);
893
+ } finally {
894
+ wasm.__wbindgen_add_to_stack_pointer(16);
895
+ }
896
+ }
897
+ /**
898
+ * Get a value from the schema using dotted path notation
899
+ *
900
+ * @param path - Dotted path to the value (e.g., "properties.field.value")
901
+ * @returns Value as JSON string or null if not found
902
+ * @param {string} path
903
+ * @returns {string | undefined}
904
+ */
905
+ getSchemaByPath(path) {
906
+ try {
907
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
908
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
909
+ const len0 = WASM_VECTOR_LEN;
910
+ wasm.jsonevalwasm_getSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0);
911
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
912
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
913
+ let v2;
914
+ if (r0 !== 0) {
915
+ v2 = getStringFromWasm0(r0, r1).slice();
916
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
917
+ }
918
+ return v2;
919
+ } finally {
920
+ wasm.__wbindgen_add_to_stack_pointer(16);
921
+ }
922
+ }
923
+ /**
924
+ * Get values from schema using multiple dotted paths
925
+ * @param pathsJson - JSON array of dotted paths
926
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
927
+ * @returns Data in specified format as JSON string
928
+ * @param {string} paths_json
929
+ * @param {number} format
930
+ * @returns {string}
931
+ */
932
+ getSchemaByPaths(paths_json, format) {
933
+ let deferred3_0;
934
+ let deferred3_1;
935
+ try {
936
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
937
+ const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
938
+ const len0 = WASM_VECTOR_LEN;
939
+ wasm.jsonevalwasm_getSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, format);
940
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
941
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
942
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
943
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
944
+ var ptr2 = r0;
945
+ var len2 = r1;
946
+ if (r3) {
947
+ ptr2 = 0; len2 = 0;
948
+ throw takeObject(r2);
949
+ }
950
+ deferred3_0 = ptr2;
951
+ deferred3_1 = len2;
952
+ return getStringFromWasm0(ptr2, len2);
953
+ } finally {
954
+ wasm.__wbindgen_add_to_stack_pointer(16);
955
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
956
+ }
957
+ }
958
+ /**
959
+ * Get the evaluated schema with optional layout resolution
960
+ *
961
+ * @param skipLayout - Whether to skip layout resolution
962
+ * @returns Evaluated schema as JSON string
963
+ * @param {boolean} skip_layout
964
+ * @returns {string}
965
+ */
966
+ getEvaluatedSchema(skip_layout) {
967
+ let deferred1_0;
968
+ let deferred1_1;
969
+ try {
970
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
971
+ wasm.jsonevalwasm_getEvaluatedSchema(retptr, this.__wbg_ptr, skip_layout);
972
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
973
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
974
+ deferred1_0 = r0;
975
+ deferred1_1 = r1;
976
+ return getStringFromWasm0(r0, r1);
977
+ } finally {
978
+ wasm.__wbindgen_add_to_stack_pointer(16);
979
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
980
+ }
981
+ }
982
+ /**
983
+ * Get a value from the schema using dotted path notation as JavaScript object
984
+ *
985
+ * @param path - Dotted path to the value (e.g., "properties.field.value")
986
+ * @returns Value as JavaScript object or null if not found
987
+ * @param {string} path
988
+ * @returns {any}
989
+ */
990
+ getSchemaByPathJS(path) {
991
+ try {
992
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
993
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
994
+ const len0 = WASM_VECTOR_LEN;
995
+ wasm.jsonevalwasm_getSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0);
996
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
997
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
998
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
999
+ if (r2) {
1000
+ throw takeObject(r1);
1001
+ }
1002
+ return takeObject(r0);
1003
+ } finally {
1004
+ wasm.__wbindgen_add_to_stack_pointer(16);
1005
+ }
1006
+ }
1007
+ /**
1008
+ * Reload schema from MessagePack-encoded bytes
1009
+ *
1010
+ * @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
1011
+ * @param context - Optional context data JSON string
1012
+ * @param data - Optional initial data JSON string
1013
+ * @param {Uint8Array} schema_msgpack
1014
+ * @param {string | null} [context]
1015
+ * @param {string | null} [data]
1016
+ */
1017
+ reloadSchemaMsgpack(schema_msgpack, context, data) {
1018
+ try {
1019
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1020
+ const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export_0);
1021
+ const len0 = WASM_VECTOR_LEN;
1022
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1023
+ var len1 = WASM_VECTOR_LEN;
1024
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1025
+ var len2 = WASM_VECTOR_LEN;
1026
+ wasm.jsonevalwasm_reloadSchemaMsgpack(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1027
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1028
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1029
+ if (r1) {
1030
+ throw takeObject(r0);
1031
+ }
1032
+ } finally {
1033
+ wasm.__wbindgen_add_to_stack_pointer(16);
1034
+ }
1035
+ }
1036
+ /**
1037
+ * Get values from schema using multiple dotted paths (JS object)
1038
+ * @param pathsJson - JSON array of dotted paths
1039
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1040
+ * @returns Data in specified format as JavaScript object
1041
+ * @param {string} paths_json
1042
+ * @param {number} format
1043
+ * @returns {any}
1044
+ */
1045
+ getSchemaByPathsJS(paths_json, format) {
1046
+ try {
1047
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1048
+ const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1049
+ const len0 = WASM_VECTOR_LEN;
1050
+ wasm.jsonevalwasm_getSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, format);
1051
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1052
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1053
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1054
+ if (r2) {
1055
+ throw takeObject(r1);
1056
+ }
1057
+ return takeObject(r0);
1058
+ } finally {
1059
+ wasm.__wbindgen_add_to_stack_pointer(16);
1060
+ }
1061
+ }
1062
+ /**
1063
+ * Get the evaluated schema as JavaScript object
1064
+ *
1065
+ * @param skipLayout - Whether to skip layout resolution
1066
+ * @returns Evaluated schema as JavaScript object
1067
+ * @param {boolean} skip_layout
1068
+ * @returns {any}
1069
+ */
1070
+ getEvaluatedSchemaJS(skip_layout) {
1071
+ try {
1072
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1073
+ wasm.jsonevalwasm_getEvaluatedSchemaJS(retptr, this.__wbg_ptr, skip_layout);
1074
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1075
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1076
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1077
+ if (r2) {
1078
+ throw takeObject(r1);
1079
+ }
1080
+ return takeObject(r0);
1081
+ } finally {
1082
+ wasm.__wbindgen_add_to_stack_pointer(16);
1083
+ }
1084
+ }
1085
+ /**
1086
+ * Reload schema from ParsedSchemaCache using a cache key
1087
+ *
1088
+ * @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
1089
+ * @param context - Optional context data JSON string
1090
+ * @param data - Optional initial data JSON string
1091
+ * @param {string} cache_key
1092
+ * @param {string | null} [context]
1093
+ * @param {string | null} [data]
1094
+ */
1095
+ reloadSchemaFromCache(cache_key, context, data) {
1096
+ try {
1097
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1098
+ const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1099
+ const len0 = WASM_VECTOR_LEN;
1100
+ var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1101
+ var len1 = WASM_VECTOR_LEN;
1102
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1103
+ var len2 = WASM_VECTOR_LEN;
1104
+ wasm.jsonevalwasm_reloadSchemaFromCache(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1105
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1106
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1107
+ if (r1) {
1108
+ throw takeObject(r0);
1109
+ }
1110
+ } finally {
1111
+ wasm.__wbindgen_add_to_stack_pointer(16);
1112
+ }
1113
+ }
1114
+ /**
1115
+ * Get a value from the evaluated schema using dotted path notation
1116
+ *
1117
+ * @param path - Dotted path to the value (e.g., "properties.field.value")
1118
+ * @param skipLayout - Whether to skip layout resolution
1119
+ * @returns Value as JSON string or null if not found
1120
+ * @param {string} path
1121
+ * @param {boolean} skip_layout
1122
+ * @returns {string | undefined}
1123
+ */
1124
+ getEvaluatedSchemaByPath(path, skip_layout) {
1125
+ try {
1126
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1127
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1128
+ const len0 = WASM_VECTOR_LEN;
1129
+ wasm.jsonevalwasm_getEvaluatedSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
1130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1132
+ let v2;
1133
+ if (r0 !== 0) {
1134
+ v2 = getStringFromWasm0(r0, r1).slice();
1135
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1136
+ }
1137
+ return v2;
1138
+ } finally {
1139
+ wasm.__wbindgen_add_to_stack_pointer(16);
1140
+ }
1141
+ }
1142
+ /**
1143
+ * Get the evaluated schema in MessagePack format
1144
+ *
1145
+ * @param skipLayout - Whether to skip layout resolution
1146
+ * @returns Evaluated schema as MessagePack bytes (Uint8Array)
1147
+ *
1148
+ * # Zero-Copy Optimization
1149
+ *
1150
+ * This method returns MessagePack binary data with minimal copying:
1151
+ * 1. Serializes schema to Vec<u8> in Rust (unavoidable)
1152
+ * 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
1153
+ * 3. Result is a Uint8Array view (minimal overhead)
1154
+ *
1155
+ * MessagePack format is 20-50% smaller than JSON, ideal for web/WASM.
1156
+ * @param {boolean} skip_layout
1157
+ * @returns {Uint8Array}
1158
+ */
1159
+ getEvaluatedSchemaMsgpack(skip_layout) {
1160
+ try {
1161
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1162
+ wasm.jsonevalwasm_getEvaluatedSchemaMsgpack(retptr, this.__wbg_ptr, skip_layout);
1163
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1164
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1165
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1166
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1167
+ if (r3) {
1168
+ throw takeObject(r2);
1169
+ }
1170
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1171
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1172
+ return v1;
1173
+ } finally {
1174
+ wasm.__wbindgen_add_to_stack_pointer(16);
1175
+ }
1176
+ }
1177
+ /**
1178
+ * Get values from evaluated schema using multiple dotted paths
1179
+ * @param pathsJson - JSON array of dotted paths
1180
+ * @param skipLayout - Whether to skip layout resolution
1181
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1182
+ * @returns Data in specified format as JSON string
1183
+ * @param {string} paths_json
1184
+ * @param {boolean} skip_layout
1185
+ * @param {number} format
1186
+ * @returns {string}
1187
+ */
1188
+ getEvaluatedSchemaByPaths(paths_json, skip_layout, format) {
1189
+ let deferred3_0;
1190
+ let deferred3_1;
1191
+ try {
1192
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1193
+ const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1194
+ const len0 = WASM_VECTOR_LEN;
1195
+ wasm.jsonevalwasm_getEvaluatedSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
1196
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1197
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1198
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1199
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1200
+ var ptr2 = r0;
1201
+ var len2 = r1;
1202
+ if (r3) {
1203
+ ptr2 = 0; len2 = 0;
1204
+ throw takeObject(r2);
1205
+ }
1206
+ deferred3_0 = ptr2;
1207
+ deferred3_1 = len2;
1208
+ return getStringFromWasm0(ptr2, len2);
1209
+ } finally {
1210
+ wasm.__wbindgen_add_to_stack_pointer(16);
1211
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
1212
+ }
1213
+ }
1214
+ /**
1215
+ * Get a value from the evaluated schema using dotted path notation as JavaScript object
1216
+ *
1217
+ * @param path - Dotted path to the value (e.g., "properties.field.value")
1218
+ * @param skipLayout - Whether to skip layout resolution
1219
+ * @returns Value as JavaScript object or null if not found
1220
+ * @param {string} path
1221
+ * @param {boolean} skip_layout
1222
+ * @returns {any}
1223
+ */
1224
+ getEvaluatedSchemaByPathJS(path, skip_layout) {
1225
+ try {
1226
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1227
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1228
+ const len0 = WASM_VECTOR_LEN;
1229
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
1230
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1231
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1232
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1233
+ if (r2) {
1234
+ throw takeObject(r1);
1235
+ }
1236
+ return takeObject(r0);
1237
+ } finally {
1238
+ wasm.__wbindgen_add_to_stack_pointer(16);
1239
+ }
1240
+ }
1241
+ /**
1242
+ * Get values from evaluated schema using multiple dotted paths (JS object)
1243
+ * @param pathsJson - JSON array of dotted paths
1244
+ * @param skipLayout - Whether to skip layout resolution
1245
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1246
+ * @returns Data in specified format as JavaScript object
1247
+ * @param {string} paths_json
1248
+ * @param {boolean} skip_layout
1249
+ * @param {number} format
1250
+ * @returns {any}
1251
+ */
1252
+ getEvaluatedSchemaByPathsJS(paths_json, skip_layout, format) {
1253
+ try {
1254
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1255
+ const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1256
+ const len0 = WASM_VECTOR_LEN;
1257
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
1258
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1259
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1260
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1261
+ if (r2) {
1262
+ throw takeObject(r1);
1263
+ }
1264
+ return takeObject(r0);
1265
+ } finally {
1266
+ wasm.__wbindgen_add_to_stack_pointer(16);
1267
+ }
1268
+ }
1269
+ /**
1270
+ * Get the evaluated schema without $params field
1271
+ *
1272
+ * @param skipLayout - Whether to skip layout resolution
1273
+ * @returns Evaluated schema as JSON string
1274
+ * @param {boolean} skip_layout
1275
+ * @returns {string}
1276
+ */
1277
+ getEvaluatedSchemaWithoutParams(skip_layout) {
1278
+ let deferred1_0;
1279
+ let deferred1_1;
1280
+ try {
1281
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1282
+ wasm.jsonevalwasm_getEvaluatedSchemaWithoutParams(retptr, this.__wbg_ptr, skip_layout);
1283
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1284
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1285
+ deferred1_0 = r0;
1286
+ deferred1_1 = r1;
1287
+ return getStringFromWasm0(r0, r1);
1288
+ } finally {
1289
+ wasm.__wbindgen_add_to_stack_pointer(16);
1290
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
1291
+ }
1292
+ }
1293
+ /**
1294
+ * Get the evaluated schema without $params as JavaScript object
1295
+ *
1296
+ * @param skipLayout - Whether to skip layout resolution
1297
+ * @returns Evaluated schema as JavaScript object
1298
+ * @param {boolean} skip_layout
1299
+ * @returns {any}
1300
+ */
1301
+ getEvaluatedSchemaWithoutParamsJS(skip_layout) {
1302
+ try {
1303
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1304
+ wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsJS(retptr, this.__wbg_ptr, skip_layout);
1305
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1306
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1307
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1308
+ if (r2) {
1309
+ throw takeObject(r1);
1310
+ }
1311
+ return takeObject(r0);
1312
+ } finally {
1313
+ wasm.__wbindgen_add_to_stack_pointer(16);
1314
+ }
1315
+ }
1316
+ /**
1317
+ * Check if a subform exists at the given path
1318
+ *
1319
+ * @param subformPath - Path to check
1320
+ * @returns True if subform exists, false otherwise
1321
+ * @param {string} subform_path
1322
+ * @returns {boolean}
1323
+ */
1324
+ hasSubform(subform_path) {
1325
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1326
+ const len0 = WASM_VECTOR_LEN;
1327
+ const ret = wasm.jsonevalwasm_hasSubform(this.__wbg_ptr, ptr0, len0);
1328
+ return ret !== 0;
1329
+ }
1330
+ /**
1331
+ * Evaluate a subform with data
1332
+ *
1333
+ * @param subformPath - Path to the subform (e.g., "#/riders")
1334
+ * @param data - JSON data string for the subform
1335
+ * @param context - Optional context data JSON string
1336
+ * @param paths - Optional array of paths to evaluate (JSON string array)
1337
+ * @throws Error if evaluation fails
1338
+ * @param {string} subform_path
1339
+ * @param {string} data
1340
+ * @param {string | null} [context]
1341
+ * @param {string[] | null} [paths]
1342
+ */
1343
+ evaluateSubform(subform_path, data, context, paths) {
1344
+ try {
1345
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1346
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1347
+ const len0 = WASM_VECTOR_LEN;
1348
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1349
+ const len1 = WASM_VECTOR_LEN;
1350
+ var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1351
+ var len2 = WASM_VECTOR_LEN;
1352
+ var ptr3 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
1353
+ var len3 = WASM_VECTOR_LEN;
1354
+ wasm.jsonevalwasm_evaluateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1355
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1356
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1357
+ if (r1) {
1358
+ throw takeObject(r0);
1359
+ }
1360
+ } finally {
1361
+ wasm.__wbindgen_add_to_stack_pointer(16);
1362
+ }
1363
+ }
1364
+ /**
1365
+ * Validate subform data against its schema rules
1366
+ *
1367
+ * @param subformPath - Path to the subform
1368
+ * @param data - JSON data string for the subform
1369
+ * @param context - Optional context data JSON string
1370
+ * @returns ValidationResult
1371
+ * @param {string} subform_path
1372
+ * @param {string} data
1373
+ * @param {string | null} [context]
1374
+ * @returns {ValidationResult}
1375
+ */
1376
+ validateSubform(subform_path, data, context) {
1377
+ try {
1378
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1379
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1380
+ const len0 = WASM_VECTOR_LEN;
1381
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1382
+ const len1 = WASM_VECTOR_LEN;
1383
+ var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1384
+ var len2 = WASM_VECTOR_LEN;
1385
+ wasm.jsonevalwasm_validateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1386
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1387
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1388
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1389
+ if (r2) {
1390
+ throw takeObject(r1);
1391
+ }
1392
+ return ValidationResult.__wrap(r0);
1393
+ } finally {
1394
+ wasm.__wbindgen_add_to_stack_pointer(16);
1395
+ }
1396
+ }
1397
+ /**
1398
+ * Get list of available subform paths
1399
+ *
1400
+ * @returns Array of subform paths
1401
+ * @returns {string[]}
1402
+ */
1403
+ getSubformPaths() {
1404
+ try {
1405
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1406
+ wasm.jsonevalwasm_getSubformPaths(retptr, this.__wbg_ptr);
1407
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1408
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1409
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1410
+ wasm.__wbindgen_export_2(r0, r1 * 4, 4);
1411
+ return v1;
1412
+ } finally {
1413
+ wasm.__wbindgen_add_to_stack_pointer(16);
1414
+ }
1415
+ }
1416
+ /**
1417
+ * Resolve layout for subform
1418
+ *
1419
+ * @param subformPath - Path to the subform
1420
+ * @param evaluate - If true, runs evaluation before resolving layout
1421
+ * @throws Error if resolve fails
1422
+ * @param {string} subform_path
1423
+ * @param {boolean} evaluate
1424
+ */
1425
+ resolveLayoutSubform(subform_path, evaluate) {
1426
+ try {
1427
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1428
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1429
+ const len0 = WASM_VECTOR_LEN;
1430
+ wasm.jsonevalwasm_resolveLayoutSubform(retptr, this.__wbg_ptr, ptr0, len0, evaluate);
1431
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1432
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1433
+ if (r1) {
1434
+ throw takeObject(r0);
1435
+ }
1436
+ } finally {
1437
+ wasm.__wbindgen_add_to_stack_pointer(16);
1438
+ }
1439
+ }
1440
+ /**
1441
+ * Get schema value from subform (all .value fields)
1442
+ *
1443
+ * @param subformPath - Path to the subform
1444
+ * @returns Modified data as JavaScript object
1445
+ * @param {string} subform_path
1446
+ * @returns {any}
1447
+ */
1448
+ getSchemaValueSubform(subform_path) {
1449
+ try {
1450
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1451
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1452
+ const len0 = WASM_VECTOR_LEN;
1453
+ wasm.jsonevalwasm_getSchemaValueSubform(retptr, this.__wbg_ptr, ptr0, len0);
1454
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1455
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1456
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1457
+ if (r2) {
1458
+ throw takeObject(r1);
1459
+ }
1460
+ return takeObject(r0);
1461
+ } finally {
1462
+ wasm.__wbindgen_add_to_stack_pointer(16);
1463
+ }
1464
+ }
1465
+ /**
1466
+ * Get schema by specific path from subform (returns JSON string)
1467
+ * @param subformPath - Path to the subform
1468
+ * @param schemaPath - Path within the subform
1469
+ * @returns Value as JSON string or null if not found
1470
+ * @param {string} subform_path
1471
+ * @param {string} schema_path
1472
+ * @returns {string | undefined}
1473
+ */
1474
+ getSchemaByPathSubform(subform_path, schema_path) {
1475
+ try {
1476
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1477
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1478
+ const len0 = WASM_VECTOR_LEN;
1479
+ const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1480
+ const len1 = WASM_VECTOR_LEN;
1481
+ wasm.jsonevalwasm_getSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1482
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1483
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1484
+ let v3;
1485
+ if (r0 !== 0) {
1486
+ v3 = getStringFromWasm0(r0, r1).slice();
1487
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1488
+ }
1489
+ return v3;
1490
+ } finally {
1491
+ wasm.__wbindgen_add_to_stack_pointer(16);
1492
+ }
1493
+ }
1494
+ /**
1495
+ * Evaluate dependents in subform when a field changes
1496
+ *
1497
+ * @param subformPath - Path to the subform
1498
+ * @param changedPath - Path of the field that changed
1499
+ * @param data - Optional updated JSON data string
1500
+ * @param context - Optional context data JSON string
1501
+ * @returns Array of dependent change objects as JSON string
1502
+ * @param {string} subform_path
1503
+ * @param {string} changed_path
1504
+ * @param {string | null} [data]
1505
+ * @param {string | null} [context]
1506
+ * @returns {string}
1507
+ */
1508
+ evaluateDependentsSubform(subform_path, changed_path, data, context) {
1509
+ let deferred6_0;
1510
+ let deferred6_1;
1511
+ try {
1512
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1513
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1514
+ const len0 = WASM_VECTOR_LEN;
1515
+ const ptr1 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1516
+ const len1 = WASM_VECTOR_LEN;
1517
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1518
+ var len2 = WASM_VECTOR_LEN;
1519
+ var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1520
+ var len3 = WASM_VECTOR_LEN;
1521
+ wasm.jsonevalwasm_evaluateDependentsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1522
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1523
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1524
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1525
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1526
+ var ptr5 = r0;
1527
+ var len5 = r1;
1528
+ if (r3) {
1529
+ ptr5 = 0; len5 = 0;
1530
+ throw takeObject(r2);
1531
+ }
1532
+ deferred6_0 = ptr5;
1533
+ deferred6_1 = len5;
1534
+ return getStringFromWasm0(ptr5, len5);
1535
+ } finally {
1536
+ wasm.__wbindgen_add_to_stack_pointer(16);
1537
+ wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
1538
+ }
1539
+ }
1540
+ /**
1541
+ * Get schema by multiple paths from subform
1542
+ * @param subformPath - Path to the subform
1543
+ * @param pathsJson - JSON array of dotted paths
1544
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1545
+ * @returns Data in specified format as JSON string
1546
+ * @param {string} subform_path
1547
+ * @param {string} paths_json
1548
+ * @param {number} format
1549
+ * @returns {string}
1550
+ */
1551
+ getSchemaByPathsSubform(subform_path, paths_json, format) {
1552
+ let deferred4_0;
1553
+ let deferred4_1;
1554
+ try {
1555
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1556
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1557
+ const len0 = WASM_VECTOR_LEN;
1558
+ const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1559
+ const len1 = WASM_VECTOR_LEN;
1560
+ wasm.jsonevalwasm_getSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
1561
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1562
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1563
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1564
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1565
+ var ptr3 = r0;
1566
+ var len3 = r1;
1567
+ if (r3) {
1568
+ ptr3 = 0; len3 = 0;
1569
+ throw takeObject(r2);
1570
+ }
1571
+ deferred4_0 = ptr3;
1572
+ deferred4_1 = len3;
1573
+ return getStringFromWasm0(ptr3, len3);
1574
+ } finally {
1575
+ wasm.__wbindgen_add_to_stack_pointer(16);
1576
+ wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1577
+ }
1578
+ }
1579
+ /**
1580
+ * Get evaluated schema from subform
1581
+ *
1582
+ * @param subformPath - Path to the subform
1583
+ * @param resolveLayout - Whether to resolve layout
1584
+ * @returns Evaluated schema as JSON string
1585
+ * @param {string} subform_path
1586
+ * @param {boolean} resolve_layout
1587
+ * @returns {string}
1588
+ */
1589
+ getEvaluatedSchemaSubform(subform_path, resolve_layout) {
1590
+ let deferred2_0;
1591
+ let deferred2_1;
1592
+ try {
1593
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1594
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1595
+ const len0 = WASM_VECTOR_LEN;
1596
+ wasm.jsonevalwasm_getEvaluatedSchemaSubform(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
1597
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1598
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1599
+ deferred2_0 = r0;
1600
+ deferred2_1 = r1;
1601
+ return getStringFromWasm0(r0, r1);
1602
+ } finally {
1603
+ wasm.__wbindgen_add_to_stack_pointer(16);
1604
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1605
+ }
1606
+ }
1607
+ /**
1608
+ * Get schema by specific path from subform (returns JS object)
1609
+ * @param subformPath - Path to the subform
1610
+ * @param schemaPath - Path within the subform
1611
+ * @returns Value as JavaScript object or null if not found
1612
+ * @param {string} subform_path
1613
+ * @param {string} schema_path
1614
+ * @returns {any}
1615
+ */
1616
+ getSchemaByPathSubformJS(subform_path, schema_path) {
1617
+ try {
1618
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1619
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1620
+ const len0 = WASM_VECTOR_LEN;
1621
+ const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1622
+ const len1 = WASM_VECTOR_LEN;
1623
+ wasm.jsonevalwasm_getSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1624
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1625
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1626
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1627
+ if (r2) {
1628
+ throw takeObject(r1);
1629
+ }
1630
+ return takeObject(r0);
1631
+ } finally {
1632
+ wasm.__wbindgen_add_to_stack_pointer(16);
1633
+ }
1634
+ }
1635
+ /**
1636
+ * Evaluate dependents in subform and return as JavaScript object
1637
+ *
1638
+ * @param subformPath - Path to the subform
1639
+ * @param changedPath - Path of the field that changed
1640
+ * @param data - Optional updated JSON data string
1641
+ * @param context - Optional context data JSON string
1642
+ * @returns Array of dependent change objects as JavaScript object
1643
+ * @param {string} subform_path
1644
+ * @param {string} changed_path
1645
+ * @param {string | null} [data]
1646
+ * @param {string | null} [context]
1647
+ * @returns {any}
1648
+ */
1649
+ evaluateDependentsSubformJS(subform_path, changed_path, data, context) {
1650
+ try {
1651
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1652
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1653
+ const len0 = WASM_VECTOR_LEN;
1654
+ const ptr1 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1655
+ const len1 = WASM_VECTOR_LEN;
1656
+ var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1657
+ var len2 = WASM_VECTOR_LEN;
1658
+ var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1659
+ var len3 = WASM_VECTOR_LEN;
1660
+ wasm.jsonevalwasm_evaluateDependentsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1661
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1662
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1663
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1664
+ if (r2) {
1665
+ throw takeObject(r1);
1666
+ }
1667
+ return takeObject(r0);
1668
+ } finally {
1669
+ wasm.__wbindgen_add_to_stack_pointer(16);
1670
+ }
1671
+ }
1672
+ /**
1673
+ * Get schema by multiple paths from subform (JS object)
1674
+ * @param subformPath - Path to the subform
1675
+ * @param pathsJson - JSON array of dotted paths
1676
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1677
+ * @returns Data in specified format as JavaScript object
1678
+ * @param {string} subform_path
1679
+ * @param {string} paths_json
1680
+ * @param {number} format
1681
+ * @returns {any}
1682
+ */
1683
+ getSchemaByPathsSubformJS(subform_path, paths_json, format) {
1684
+ try {
1685
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1686
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1687
+ const len0 = WASM_VECTOR_LEN;
1688
+ const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1689
+ const len1 = WASM_VECTOR_LEN;
1690
+ wasm.jsonevalwasm_getSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
1691
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1692
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1693
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1694
+ if (r2) {
1695
+ throw takeObject(r1);
1696
+ }
1697
+ return takeObject(r0);
1698
+ } finally {
1699
+ wasm.__wbindgen_add_to_stack_pointer(16);
1700
+ }
1701
+ }
1702
+ /**
1703
+ * Get evaluated schema from subform as JavaScript object
1704
+ *
1705
+ * @param subformPath - Path to the subform
1706
+ * @param resolveLayout - Whether to resolve layout
1707
+ * @returns Evaluated schema as JavaScript object
1708
+ * @param {string} subform_path
1709
+ * @param {boolean} resolve_layout
1710
+ * @returns {any}
1711
+ */
1712
+ getEvaluatedSchemaSubformJS(subform_path, resolve_layout) {
1713
+ try {
1714
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1715
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1716
+ const len0 = WASM_VECTOR_LEN;
1717
+ wasm.jsonevalwasm_getEvaluatedSchemaSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
1718
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1719
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1720
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1721
+ if (r2) {
1722
+ throw takeObject(r1);
1723
+ }
1724
+ return takeObject(r0);
1725
+ } finally {
1726
+ wasm.__wbindgen_add_to_stack_pointer(16);
1727
+ }
1728
+ }
1729
+ /**
1730
+ * Get evaluated schema by specific path from subform
1731
+ *
1732
+ * @param subformPath - Path to the subform
1733
+ * @param schemaPath - Dotted path to the value within the subform
1734
+ * @param skipLayout - Whether to skip layout resolution
1735
+ * @returns Value as JSON string or null if not found
1736
+ * @param {string} subform_path
1737
+ * @param {string} schema_path
1738
+ * @param {boolean} skip_layout
1739
+ * @returns {string | undefined}
1740
+ */
1741
+ getEvaluatedSchemaByPathSubform(subform_path, schema_path, skip_layout) {
1742
+ try {
1743
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1744
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1745
+ const len0 = WASM_VECTOR_LEN;
1746
+ const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1747
+ const len1 = WASM_VECTOR_LEN;
1748
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
1749
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1750
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1751
+ let v3;
1752
+ if (r0 !== 0) {
1753
+ v3 = getStringFromWasm0(r0, r1).slice();
1754
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1755
+ }
1756
+ return v3;
1757
+ } finally {
1758
+ wasm.__wbindgen_add_to_stack_pointer(16);
1759
+ }
1760
+ }
1761
+ /**
1762
+ * Get values from the evaluated schema of a subform using multiple dotted path notations (returns JSON string)
1763
+ * @param subformPath - Path to the subform
1764
+ * @param pathsJson - JSON array of dotted paths
1765
+ * @param skipLayout - Whether to skip layout resolution
1766
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1767
+ * @returns Data in specified format as JSON string
1768
+ * @param {string} subform_path
1769
+ * @param {string} paths_json
1770
+ * @param {boolean} skip_layout
1771
+ * @param {number} format
1772
+ * @returns {string}
1773
+ */
1774
+ getEvaluatedSchemaByPathsSubform(subform_path, paths_json, skip_layout, format) {
1775
+ let deferred4_0;
1776
+ let deferred4_1;
1777
+ try {
1778
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1779
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1780
+ const len0 = WASM_VECTOR_LEN;
1781
+ const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1782
+ const len1 = WASM_VECTOR_LEN;
1783
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout, format);
1784
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1785
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1786
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1787
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1788
+ var ptr3 = r0;
1789
+ var len3 = r1;
1790
+ if (r3) {
1791
+ ptr3 = 0; len3 = 0;
1792
+ throw takeObject(r2);
1793
+ }
1794
+ deferred4_0 = ptr3;
1795
+ deferred4_1 = len3;
1796
+ return getStringFromWasm0(ptr3, len3);
1797
+ } finally {
1798
+ wasm.__wbindgen_add_to_stack_pointer(16);
1799
+ wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
1800
+ }
1801
+ }
1802
+ /**
1803
+ * Get evaluated schema by specific path from subform as JavaScript object
1804
+ *
1805
+ * @param subformPath - Path to the subform
1806
+ * @param schemaPath - Dotted path to the value within the subform
1807
+ * @param skipLayout - Whether to skip layout resolution
1808
+ * @returns Value as JavaScript object or null if not found
1809
+ * @param {string} subform_path
1810
+ * @param {string} schema_path
1811
+ * @param {boolean} skip_layout
1812
+ * @returns {any}
1813
+ */
1814
+ getEvaluatedSchemaByPathSubformJS(subform_path, schema_path, skip_layout) {
1815
+ try {
1816
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1817
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1818
+ const len0 = WASM_VECTOR_LEN;
1819
+ const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1820
+ const len1 = WASM_VECTOR_LEN;
1821
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
1822
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1823
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1824
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1825
+ if (r2) {
1826
+ throw takeObject(r1);
1827
+ }
1828
+ return takeObject(r0);
1829
+ } finally {
1830
+ wasm.__wbindgen_add_to_stack_pointer(16);
1831
+ }
1832
+ }
1833
+ /**
1834
+ * Get values from the evaluated schema of a subform using multiple dotted path notations (returns JS object)
1835
+ * @param subformPath - Path to the subform
1836
+ * @param pathsJson - JSON array of dotted paths
1837
+ * @param skipLayout - Whether to skip layout resolution
1838
+ * @param format - Return format (0=Nested, 1=Flat, 2=Array)
1839
+ * @returns Data in specified format as JavaScript object
1840
+ * @param {string} subform_path
1841
+ * @param {string} paths_json
1842
+ * @param {boolean} skip_layout
1843
+ * @param {number} format
1844
+ * @returns {any}
1845
+ */
1846
+ getEvaluatedSchemaByPathsSubformJS(subform_path, paths_json, skip_layout, format) {
1847
+ try {
1848
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1849
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1850
+ const len0 = WASM_VECTOR_LEN;
1851
+ const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1852
+ const len1 = WASM_VECTOR_LEN;
1853
+ wasm.jsonevalwasm_getEvaluatedSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout, format);
1854
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1855
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1856
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1857
+ if (r2) {
1858
+ throw takeObject(r1);
1859
+ }
1860
+ return takeObject(r0);
1861
+ } finally {
1862
+ wasm.__wbindgen_add_to_stack_pointer(16);
1863
+ }
1864
+ }
1865
+ /**
1866
+ * Get evaluated schema without $params from subform
1867
+ *
1868
+ * @param subformPath - Path to the subform
1869
+ * @param resolveLayout - Whether to resolve layout
1870
+ * @returns Evaluated schema as JSON string
1871
+ * @param {string} subform_path
1872
+ * @param {boolean} resolve_layout
1873
+ * @returns {string}
1874
+ */
1875
+ getEvaluatedSchemaWithoutParamsSubform(subform_path, resolve_layout) {
1876
+ let deferred2_0;
1877
+ let deferred2_1;
1878
+ try {
1879
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1880
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1881
+ const len0 = WASM_VECTOR_LEN;
1882
+ wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubform(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
1883
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1884
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1885
+ deferred2_0 = r0;
1886
+ deferred2_1 = r1;
1887
+ return getStringFromWasm0(r0, r1);
1888
+ } finally {
1889
+ wasm.__wbindgen_add_to_stack_pointer(16);
1890
+ wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
1891
+ }
1892
+ }
1893
+ /**
1894
+ * Get evaluated schema without $params from subform as JavaScript object
1895
+ *
1896
+ * @param subformPath - Path to the subform
1897
+ * @param resolveLayout - Whether to resolve layout
1898
+ * @returns Evaluated schema as JavaScript object
1899
+ * @param {string} subform_path
1900
+ * @param {boolean} resolve_layout
1901
+ * @returns {any}
1902
+ */
1903
+ getEvaluatedSchemaWithoutParamsSubformJS(subform_path, resolve_layout) {
1904
+ try {
1905
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1906
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1907
+ const len0 = WASM_VECTOR_LEN;
1908
+ wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
1909
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1910
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1911
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1912
+ if (r2) {
1913
+ throw takeObject(r1);
1914
+ }
1915
+ return takeObject(r0);
1916
+ } finally {
1917
+ wasm.__wbindgen_add_to_stack_pointer(16);
1918
+ }
1919
+ }
1920
+ }
1921
+ if (Symbol.dispose) JSONEvalWasm.prototype[Symbol.dispose] = JSONEvalWasm.prototype.free;
1922
+
1923
+ const ValidationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1924
+ ? { register: () => {}, unregister: () => {} }
1925
+ : new FinalizationRegistry(ptr => wasm.__wbg_validationerror_free(ptr >>> 0, 1));
1926
+ /**
1927
+ * Validation error for JavaScript
1928
+ */
1929
+ export class ValidationError {
1930
+
1931
+ static __wrap(ptr) {
1932
+ ptr = ptr >>> 0;
1933
+ const obj = Object.create(ValidationError.prototype);
1934
+ obj.__wbg_ptr = ptr;
1935
+ ValidationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1936
+ return obj;
1937
+ }
1938
+
1939
+ __destroy_into_raw() {
1940
+ const ptr = this.__wbg_ptr;
1941
+ this.__wbg_ptr = 0;
1942
+ ValidationErrorFinalization.unregister(this);
1943
+ return ptr;
1944
+ }
1945
+
1946
+ free() {
1947
+ const ptr = this.__destroy_into_raw();
1948
+ wasm.__wbg_validationerror_free(ptr, 0);
1949
+ }
1950
+ /**
1951
+ * @returns {string | undefined}
1952
+ */
1953
+ get field_value() {
1954
+ try {
1955
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1956
+ wasm.validationerror_field_value(retptr, this.__wbg_ptr);
1957
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1958
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1959
+ let v1;
1960
+ if (r0 !== 0) {
1961
+ v1 = getStringFromWasm0(r0, r1).slice();
1962
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1963
+ }
1964
+ return v1;
1965
+ } finally {
1966
+ wasm.__wbindgen_add_to_stack_pointer(16);
1967
+ }
1968
+ }
1969
+ /**
1970
+ * @returns {string | undefined}
1971
+ */
1972
+ get code() {
1973
+ try {
1974
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1975
+ wasm.validationerror_code(retptr, this.__wbg_ptr);
1976
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1977
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1978
+ let v1;
1979
+ if (r0 !== 0) {
1980
+ v1 = getStringFromWasm0(r0, r1).slice();
1981
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
1982
+ }
1983
+ return v1;
1984
+ } finally {
1985
+ wasm.__wbindgen_add_to_stack_pointer(16);
1986
+ }
1987
+ }
1988
+ /**
1989
+ * @returns {any}
1990
+ */
1991
+ get data() {
1992
+ const ret = wasm.validationerror_data(this.__wbg_ptr);
1993
+ return takeObject(ret);
1994
+ }
1995
+ /**
1996
+ * @returns {string}
1997
+ */
1998
+ get path() {
1999
+ let deferred1_0;
2000
+ let deferred1_1;
2001
+ try {
2002
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2003
+ wasm.validationerror_path(retptr, this.__wbg_ptr);
2004
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2005
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2006
+ deferred1_0 = r0;
2007
+ deferred1_1 = r1;
2008
+ return getStringFromWasm0(r0, r1);
2009
+ } finally {
2010
+ wasm.__wbindgen_add_to_stack_pointer(16);
2011
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2012
+ }
2013
+ }
2014
+ /**
2015
+ * @returns {string}
2016
+ */
2017
+ get message() {
2018
+ let deferred1_0;
2019
+ let deferred1_1;
2020
+ try {
2021
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2022
+ wasm.validationerror_message(retptr, this.__wbg_ptr);
2023
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2024
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2025
+ deferred1_0 = r0;
2026
+ deferred1_1 = r1;
2027
+ return getStringFromWasm0(r0, r1);
2028
+ } finally {
2029
+ wasm.__wbindgen_add_to_stack_pointer(16);
2030
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2031
+ }
2032
+ }
2033
+ /**
2034
+ * @returns {string | undefined}
2035
+ */
2036
+ get pattern() {
2037
+ try {
2038
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2039
+ wasm.validationerror_pattern(retptr, this.__wbg_ptr);
2040
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2041
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2042
+ let v1;
2043
+ if (r0 !== 0) {
2044
+ v1 = getStringFromWasm0(r0, r1).slice();
2045
+ wasm.__wbindgen_export_2(r0, r1 * 1, 1);
2046
+ }
2047
+ return v1;
2048
+ } finally {
2049
+ wasm.__wbindgen_add_to_stack_pointer(16);
2050
+ }
2051
+ }
2052
+ /**
2053
+ * @returns {string}
2054
+ */
2055
+ get rule_type() {
2056
+ let deferred1_0;
2057
+ let deferred1_1;
2058
+ try {
2059
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2060
+ wasm.validationerror_rule_type(retptr, this.__wbg_ptr);
2061
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2062
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2063
+ deferred1_0 = r0;
2064
+ deferred1_1 = r1;
2065
+ return getStringFromWasm0(r0, r1);
2066
+ } finally {
2067
+ wasm.__wbindgen_add_to_stack_pointer(16);
2068
+ wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
2069
+ }
2070
+ }
2071
+ }
2072
+ if (Symbol.dispose) ValidationError.prototype[Symbol.dispose] = ValidationError.prototype.free;
2073
+
2074
+ const ValidationResultFinalization = (typeof FinalizationRegistry === 'undefined')
2075
+ ? { register: () => {}, unregister: () => {} }
2076
+ : new FinalizationRegistry(ptr => wasm.__wbg_validationresult_free(ptr >>> 0, 1));
2077
+ /**
2078
+ * Validation result for JavaScript
2079
+ */
2080
+ export class ValidationResult {
2081
+
2082
+ static __wrap(ptr) {
2083
+ ptr = ptr >>> 0;
2084
+ const obj = Object.create(ValidationResult.prototype);
2085
+ obj.__wbg_ptr = ptr;
2086
+ ValidationResultFinalization.register(obj, obj.__wbg_ptr, obj);
2087
+ return obj;
2088
+ }
2089
+
2090
+ __destroy_into_raw() {
2091
+ const ptr = this.__wbg_ptr;
2092
+ this.__wbg_ptr = 0;
2093
+ ValidationResultFinalization.unregister(this);
2094
+ return ptr;
2095
+ }
2096
+
2097
+ free() {
2098
+ const ptr = this.__destroy_into_raw();
2099
+ wasm.__wbg_validationresult_free(ptr, 0);
2100
+ }
2101
+ /**
2102
+ * @returns {ValidationError[]}
2103
+ */
2104
+ get errors() {
2105
+ try {
2106
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2107
+ wasm.validationresult_errors(retptr, this.__wbg_ptr);
2108
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2109
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2110
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2111
+ wasm.__wbindgen_export_2(r0, r1 * 4, 4);
2112
+ return v1;
2113
+ } finally {
2114
+ wasm.__wbindgen_add_to_stack_pointer(16);
2115
+ }
2116
+ }
2117
+ /**
2118
+ * @returns {any}
2119
+ */
2120
+ toJSON() {
2121
+ try {
2122
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2123
+ wasm.validationresult_toJSON(retptr, this.__wbg_ptr);
2124
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2125
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2126
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2127
+ if (r2) {
2128
+ throw takeObject(r1);
2129
+ }
2130
+ return takeObject(r0);
2131
+ } finally {
2132
+ wasm.__wbindgen_add_to_stack_pointer(16);
2133
+ }
2134
+ }
2135
+ /**
2136
+ * @returns {boolean}
2137
+ */
2138
+ get has_error() {
2139
+ const ret = wasm.validationresult_has_error(this.__wbg_ptr);
2140
+ return ret !== 0;
2141
+ }
2142
+ }
2143
+ if (Symbol.dispose) ValidationResult.prototype[Symbol.dispose] = ValidationResult.prototype.free;
2144
+
2145
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2146
+
2147
+ async function __wbg_load(module, imports) {
2148
+ if (typeof Response === 'function' && module instanceof Response) {
2149
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
2150
+ try {
2151
+ return await WebAssembly.instantiateStreaming(module, imports);
2152
+
2153
+ } catch (e) {
2154
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
2155
+
2156
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2157
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
2158
+
2159
+ } else {
2160
+ throw e;
2161
+ }
2162
+ }
2163
+ }
2164
+
2165
+ const bytes = await module.arrayBuffer();
2166
+ return await WebAssembly.instantiate(bytes, imports);
2167
+
2168
+ } else {
2169
+ const instance = await WebAssembly.instantiate(module, imports);
2170
+
2171
+ if (instance instanceof WebAssembly.Instance) {
2172
+ return { instance, module };
2173
+
2174
+ } else {
2175
+ return instance;
2176
+ }
2177
+ }
2178
+ }
2179
+
2180
+ function __wbg_get_imports() {
2181
+ const imports = {};
2182
+ imports.wbg = {};
2183
+ imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
2184
+ const ret = Error(getStringFromWasm0(arg0, arg1));
2185
+ return addHeapObject(ret);
2186
+ };
2187
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
2188
+ const ret = String(getObject(arg1));
2189
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
2190
+ const len1 = WASM_VECTOR_LEN;
2191
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2192
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2193
+ };
2194
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
2195
+ let deferred0_0;
2196
+ let deferred0_1;
2197
+ try {
2198
+ deferred0_0 = arg0;
2199
+ deferred0_1 = arg1;
2200
+ console.error(getStringFromWasm0(arg0, arg1));
2201
+ } finally {
2202
+ wasm.__wbindgen_export_2(deferred0_0, deferred0_1, 1);
2203
+ }
2204
+ };
2205
+ imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
2206
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
2207
+ }, arguments) };
2208
+ imports.wbg.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
2209
+ const ret = getObject(arg0).getTime();
2210
+ return ret;
2211
+ };
2212
+ imports.wbg.__wbg_log_e4f27879ca4994b8 = function(arg0, arg1) {
2213
+ console.log(getStringFromWasm0(arg0, arg1));
2214
+ };
2215
+ imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
2216
+ const ret = new Date();
2217
+ return addHeapObject(ret);
2218
+ };
2219
+ imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
2220
+ const ret = new Object();
2221
+ return addHeapObject(ret);
2222
+ };
2223
+ imports.wbg.__wbg_new_1f3a344cf3123716 = function() {
2224
+ const ret = new Array();
2225
+ return addHeapObject(ret);
2226
+ };
2227
+ imports.wbg.__wbg_new_2ff1f68f3676ea53 = function() {
2228
+ const ret = new Map();
2229
+ return addHeapObject(ret);
2230
+ };
2231
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2232
+ const ret = new Error();
2233
+ return addHeapObject(ret);
2234
+ };
2235
+ imports.wbg.__wbg_parse_442f5ba02e5eaf8b = function() { return handleError(function (arg0, arg1) {
2236
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
2237
+ return addHeapObject(ret);
2238
+ }, arguments) };
2239
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2240
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2241
+ };
2242
+ imports.wbg.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
2243
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2244
+ };
2245
+ imports.wbg.__wbg_set_b7f1cf4fae26fe2a = function(arg0, arg1, arg2) {
2246
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2247
+ return addHeapObject(ret);
2248
+ };
2249
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2250
+ const ret = getObject(arg1).stack;
2251
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
2252
+ const len1 = WASM_VECTOR_LEN;
2253
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2254
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2255
+ };
2256
+ imports.wbg.__wbg_validationerror_new = function(arg0) {
2257
+ const ret = ValidationError.__wrap(arg0);
2258
+ return addHeapObject(ret);
2259
+ };
2260
+ imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
2261
+ const ret = debugString(getObject(arg1));
2262
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
2263
+ const len1 = WASM_VECTOR_LEN;
2264
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2265
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2266
+ };
2267
+ imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
2268
+ const ret = typeof(getObject(arg0)) === 'string';
2269
+ return ret;
2270
+ };
2271
+ imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
2272
+ const obj = getObject(arg1);
2273
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2274
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
2275
+ var len1 = WASM_VECTOR_LEN;
2276
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2277
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2278
+ };
2279
+ imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
2280
+ throw new Error(getStringFromWasm0(arg0, arg1));
2281
+ };
2282
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2283
+ // Cast intrinsic for `Ref(String) -> Externref`.
2284
+ const ret = getStringFromWasm0(arg0, arg1);
2285
+ return addHeapObject(ret);
2286
+ };
2287
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
2288
+ // Cast intrinsic for `U64 -> Externref`.
2289
+ const ret = BigInt.asUintN(64, arg0);
2290
+ return addHeapObject(ret);
2291
+ };
2292
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
2293
+ // Cast intrinsic for `I64 -> Externref`.
2294
+ const ret = arg0;
2295
+ return addHeapObject(ret);
2296
+ };
2297
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
2298
+ // Cast intrinsic for `F64 -> Externref`.
2299
+ const ret = arg0;
2300
+ return addHeapObject(ret);
2301
+ };
2302
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2303
+ const ret = getObject(arg0);
2304
+ return addHeapObject(ret);
2305
+ };
2306
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2307
+ takeObject(arg0);
2308
+ };
2309
+
2310
+ return imports;
2311
+ }
2312
+
2313
+ function __wbg_init_memory(imports, memory) {
2314
+
2315
+ }
2316
+
2317
+ function __wbg_finalize_init(instance, module) {
2318
+ wasm = instance.exports;
2319
+ __wbg_init.__wbindgen_wasm_module = module;
2320
+ cachedDataViewMemory0 = null;
2321
+ cachedUint8ArrayMemory0 = null;
2322
+
2323
+
2324
+ wasm.__wbindgen_start();
2325
+ return wasm;
2326
+ }
2327
+
2328
+ function initSync(module) {
2329
+ if (wasm !== undefined) return wasm;
2330
+
2331
+
2332
+ if (typeof module !== 'undefined') {
2333
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2334
+ ({module} = module)
2335
+ } else {
2336
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2337
+ }
2338
+ }
2339
+
2340
+ const imports = __wbg_get_imports();
2341
+
2342
+ __wbg_init_memory(imports);
2343
+
2344
+ if (!(module instanceof WebAssembly.Module)) {
2345
+ module = new WebAssembly.Module(module);
2346
+ }
2347
+
2348
+ const instance = new WebAssembly.Instance(module, imports);
2349
+
2350
+ return __wbg_finalize_init(instance, module);
2351
+ }
2352
+
2353
+ async function __wbg_init(module_or_path) {
2354
+ if (wasm !== undefined) return wasm;
2355
+
2356
+
2357
+ if (typeof module_or_path !== 'undefined') {
2358
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2359
+ ({module_or_path} = module_or_path)
2360
+ } else {
2361
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2362
+ }
2363
+ }
2364
+
2365
+ if (typeof module_or_path === 'undefined') {
2366
+ module_or_path = new URL('json_eval_rs_bg.wasm', import.meta.url);
2367
+ }
2368
+ const imports = __wbg_get_imports();
2369
+
2370
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2371
+ module_or_path = fetch(module_or_path);
2372
+ }
2373
+
2374
+ __wbg_init_memory(imports);
2375
+
2376
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
2377
+
2378
+ return __wbg_finalize_init(instance, module);
2379
+ }
2380
+
2381
+ export { initSync };
2382
+ export default __wbg_init;