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