jsontrek 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "jsontrek",
3
3
  "type": "module",
4
- "version": "0.1.9",
4
+ "version": "0.1.10",
5
5
  "files": [
6
- "bundle_bg.wasm",
7
- "bundle.js",
8
- "bundle_bg.js",
9
- "bundle.d.ts"
6
+ "web_bg.wasm",
7
+ "web.js",
8
+ "web.d.ts"
10
9
  ],
11
- "main": "bundle.js",
12
- "types": "bundle.d.ts",
10
+ "main": "web.js",
11
+ "types": "web.d.ts",
13
12
  "sideEffects": [
14
- "./bundle.js",
15
13
  "./snippets/*"
16
14
  ]
17
15
  }
package/web.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * @param {any} obj
5
+ * @param {string} path
6
+ * @returns {any[]}
7
+ */
8
+ export function parse(obj: any, path: string): any[];
9
+
10
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
11
+
12
+ export interface InitOutput {
13
+ readonly memory: WebAssembly.Memory;
14
+ readonly parse: (a: number, b: number, c: number) => Array;
15
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
16
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
17
+ readonly __wbindgen_export_2: WebAssembly.Table;
18
+ readonly __externref_drop_slice: (a: number, b: number) => void;
19
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
20
+ readonly __wbindgen_exn_store: (a: number) => void;
21
+ readonly __externref_table_alloc: () => number;
22
+ readonly __wbindgen_start: () => void;
23
+ }
24
+
25
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
26
+ /**
27
+ * Instantiates the given `module`, which can either be bytes or
28
+ * a precompiled `WebAssembly.Module`.
29
+ *
30
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
31
+ *
32
+ * @returns {InitOutput}
33
+ */
34
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
35
+
36
+ /**
37
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
38
+ * for everything else, calls `WebAssembly.instantiate` directly.
39
+ *
40
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
41
+ *
42
+ * @returns {Promise<InitOutput>}
43
+ */
44
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
package/web.js ADDED
@@ -0,0 +1,514 @@
1
+ let wasm;
2
+
3
+ let WASM_VECTOR_LEN = 0;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
+
16
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
17
+ ? function (arg, view) {
18
+ return cachedTextEncoder.encodeInto(arg, view);
19
+ }
20
+ : function (arg, view) {
21
+ const buf = cachedTextEncoder.encode(arg);
22
+ view.set(buf);
23
+ return {
24
+ read: arg.length,
25
+ written: buf.length
26
+ };
27
+ });
28
+
29
+ function passStringToWasm0(arg, malloc, realloc) {
30
+
31
+ if (realloc === undefined) {
32
+ const buf = cachedTextEncoder.encode(arg);
33
+ const ptr = malloc(buf.length, 1) >>> 0;
34
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
35
+ WASM_VECTOR_LEN = buf.length;
36
+ return ptr;
37
+ }
38
+
39
+ let len = arg.length;
40
+ let ptr = malloc(len, 1) >>> 0;
41
+
42
+ const mem = getUint8ArrayMemory0();
43
+
44
+ let offset = 0;
45
+
46
+ for (; offset < len; offset++) {
47
+ const code = arg.charCodeAt(offset);
48
+ if (code > 0x7F) break;
49
+ mem[ptr + offset] = code;
50
+ }
51
+
52
+ if (offset !== len) {
53
+ if (offset !== 0) {
54
+ arg = arg.slice(offset);
55
+ }
56
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
57
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
58
+ const ret = encodeString(arg, view);
59
+
60
+ offset += ret.written;
61
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
62
+ }
63
+
64
+ WASM_VECTOR_LEN = offset;
65
+ return ptr;
66
+ }
67
+
68
+ function isLikeNone(x) {
69
+ return x === undefined || x === null;
70
+ }
71
+
72
+ let cachedDataViewMemory0 = null;
73
+
74
+ function getDataViewMemory0() {
75
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
76
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
77
+ }
78
+ return cachedDataViewMemory0;
79
+ }
80
+
81
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
82
+
83
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
84
+
85
+ function getStringFromWasm0(ptr, len) {
86
+ ptr = ptr >>> 0;
87
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
88
+ }
89
+
90
+ function debugString(val) {
91
+ // primitive types
92
+ const type = typeof val;
93
+ if (type == 'number' || type == 'boolean' || val == null) {
94
+ return `${val}`;
95
+ }
96
+ if (type == 'string') {
97
+ return `"${val}"`;
98
+ }
99
+ if (type == 'symbol') {
100
+ const description = val.description;
101
+ if (description == null) {
102
+ return 'Symbol';
103
+ } else {
104
+ return `Symbol(${description})`;
105
+ }
106
+ }
107
+ if (type == 'function') {
108
+ const name = val.name;
109
+ if (typeof name == 'string' && name.length > 0) {
110
+ return `Function(${name})`;
111
+ } else {
112
+ return 'Function';
113
+ }
114
+ }
115
+ // objects
116
+ if (Array.isArray(val)) {
117
+ const length = val.length;
118
+ let debug = '[';
119
+ if (length > 0) {
120
+ debug += debugString(val[0]);
121
+ }
122
+ for(let i = 1; i < length; i++) {
123
+ debug += ', ' + debugString(val[i]);
124
+ }
125
+ debug += ']';
126
+ return debug;
127
+ }
128
+ // Test for built-in
129
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
130
+ let className;
131
+ if (builtInMatches.length > 1) {
132
+ className = builtInMatches[1];
133
+ } else {
134
+ // Failed to match the standard '[object ClassName]'
135
+ return toString.call(val);
136
+ }
137
+ if (className == 'Object') {
138
+ // we're a user defined class or Object
139
+ // JSON.stringify avoids problems with cycles, and is generally much
140
+ // easier than looping through ownProperties of `val`.
141
+ try {
142
+ return 'Object(' + JSON.stringify(val) + ')';
143
+ } catch (_) {
144
+ return 'Object';
145
+ }
146
+ }
147
+ // errors
148
+ if (val instanceof Error) {
149
+ return `${val.name}: ${val.message}\n${val.stack}`;
150
+ }
151
+ // TODO we could test for more things here, like `Set`s and `Map`s.
152
+ return className;
153
+ }
154
+
155
+ function getArrayJsValueFromWasm0(ptr, len) {
156
+ ptr = ptr >>> 0;
157
+ const mem = getDataViewMemory0();
158
+ const result = [];
159
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
160
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
161
+ }
162
+ wasm.__externref_drop_slice(ptr, len);
163
+ return result;
164
+ }
165
+ /**
166
+ * @param {any} obj
167
+ * @param {string} path
168
+ * @returns {any[]}
169
+ */
170
+ export function parse(obj, path) {
171
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
172
+ const len0 = WASM_VECTOR_LEN;
173
+ const ret = wasm.parse(obj, ptr0, len0);
174
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
175
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
176
+ return v2;
177
+ }
178
+
179
+ function addToExternrefTable0(obj) {
180
+ const idx = wasm.__externref_table_alloc();
181
+ wasm.__wbindgen_export_2.set(idx, obj);
182
+ return idx;
183
+ }
184
+
185
+ function handleError(f, args) {
186
+ try {
187
+ return f.apply(this, args);
188
+ } catch (e) {
189
+ const idx = addToExternrefTable0(e);
190
+ wasm.__wbindgen_exn_store(idx);
191
+ }
192
+ }
193
+
194
+ async function __wbg_load(module, imports) {
195
+ if (typeof Response === 'function' && module instanceof Response) {
196
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
197
+ try {
198
+ return await WebAssembly.instantiateStreaming(module, imports);
199
+
200
+ } catch (e) {
201
+ if (module.headers.get('Content-Type') != 'application/wasm') {
202
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
203
+
204
+ } else {
205
+ throw e;
206
+ }
207
+ }
208
+ }
209
+
210
+ const bytes = await module.arrayBuffer();
211
+ return await WebAssembly.instantiate(bytes, imports);
212
+
213
+ } else {
214
+ const instance = await WebAssembly.instantiate(module, imports);
215
+
216
+ if (instance instanceof WebAssembly.Instance) {
217
+ return { instance, module };
218
+
219
+ } else {
220
+ return instance;
221
+ }
222
+ }
223
+ }
224
+
225
+ function __wbg_get_imports() {
226
+ const imports = {};
227
+ imports.wbg = {};
228
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
229
+ const obj = arg1;
230
+ const ret = typeof(obj) === 'string' ? obj : undefined;
231
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
232
+ var len1 = WASM_VECTOR_LEN;
233
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
234
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
235
+ };
236
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
237
+ const v = arg0;
238
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
239
+ return ret;
240
+ };
241
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
242
+ const ret = typeof(arg0) === 'bigint';
243
+ return ret;
244
+ };
245
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
246
+ const obj = arg1;
247
+ const ret = typeof(obj) === 'number' ? obj : undefined;
248
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
249
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
250
+ };
251
+ imports.wbg.__wbindgen_is_object = function(arg0) {
252
+ const val = arg0;
253
+ const ret = typeof(val) === 'object' && val !== null;
254
+ return ret;
255
+ };
256
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
257
+ const ret = arg0 in arg1;
258
+ return ret;
259
+ };
260
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
261
+ const ret = arg0;
262
+ return ret;
263
+ };
264
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
265
+ const ret = arg0 === arg1;
266
+ return ret;
267
+ };
268
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
269
+ const ret = BigInt.asUintN(64, arg0);
270
+ return ret;
271
+ };
272
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
273
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
274
+ return ret;
275
+ };
276
+ imports.wbg.__wbindgen_is_string = function(arg0) {
277
+ const ret = typeof(arg0) === 'string';
278
+ return ret;
279
+ };
280
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
281
+ const ret = arg0 == arg1;
282
+ return ret;
283
+ };
284
+ imports.wbg.__wbindgen_number_new = function(arg0) {
285
+ const ret = arg0;
286
+ return ret;
287
+ };
288
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
289
+ const ret = getStringFromWasm0(arg0, arg1);
290
+ return ret;
291
+ };
292
+ imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
293
+ arg0[arg1] = arg2;
294
+ };
295
+ imports.wbg.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
296
+ const ret = arg0[arg1 >>> 0];
297
+ return ret;
298
+ };
299
+ imports.wbg.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
300
+ const ret = arg0.length;
301
+ return ret;
302
+ };
303
+ imports.wbg.__wbg_new_034f913e7636e987 = function() {
304
+ const ret = new Array();
305
+ return ret;
306
+ };
307
+ imports.wbg.__wbindgen_is_function = function(arg0) {
308
+ const ret = typeof(arg0) === 'function';
309
+ return ret;
310
+ };
311
+ imports.wbg.__wbg_new_7a87a0376e40533b = function() {
312
+ const ret = new Map();
313
+ return ret;
314
+ };
315
+ imports.wbg.__wbg_next_13b477da1eaa3897 = function(arg0) {
316
+ const ret = arg0.next;
317
+ return ret;
318
+ };
319
+ imports.wbg.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
320
+ const ret = arg0.next();
321
+ return ret;
322
+ }, arguments) };
323
+ imports.wbg.__wbg_done_983b5ffcaec8c583 = function(arg0) {
324
+ const ret = arg0.done;
325
+ return ret;
326
+ };
327
+ imports.wbg.__wbg_value_2ab8a198c834c26a = function(arg0) {
328
+ const ret = arg0.value;
329
+ return ret;
330
+ };
331
+ imports.wbg.__wbg_iterator_695d699a44d6234c = function() {
332
+ const ret = Symbol.iterator;
333
+ return ret;
334
+ };
335
+ imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
336
+ const ret = Reflect.get(arg0, arg1);
337
+ return ret;
338
+ }, arguments) };
339
+ imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
340
+ const ret = arg0.call(arg1);
341
+ return ret;
342
+ }, arguments) };
343
+ imports.wbg.__wbg_new_e69b5f66fda8f13c = function() {
344
+ const ret = new Object();
345
+ return ret;
346
+ };
347
+ imports.wbg.__wbg_set_425e70f7c64ac962 = function(arg0, arg1, arg2) {
348
+ arg0[arg1 >>> 0] = arg2;
349
+ };
350
+ imports.wbg.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
351
+ const ret = Array.isArray(arg0);
352
+ return ret;
353
+ };
354
+ imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
355
+ let result;
356
+ try {
357
+ result = arg0 instanceof ArrayBuffer;
358
+ } catch (_) {
359
+ result = false;
360
+ }
361
+ const ret = result;
362
+ return ret;
363
+ };
364
+ imports.wbg.__wbg_instanceof_Map_f96986929e7e89ed = function(arg0) {
365
+ let result;
366
+ try {
367
+ result = arg0 instanceof Map;
368
+ } catch (_) {
369
+ result = false;
370
+ }
371
+ const ret = result;
372
+ return ret;
373
+ };
374
+ imports.wbg.__wbg_set_277a63e77c89279f = function(arg0, arg1, arg2) {
375
+ const ret = arg0.set(arg1, arg2);
376
+ return ret;
377
+ };
378
+ imports.wbg.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
379
+ const ret = Number.isSafeInteger(arg0);
380
+ return ret;
381
+ };
382
+ imports.wbg.__wbg_entries_c02034de337d3ee2 = function(arg0) {
383
+ const ret = Object.entries(arg0);
384
+ return ret;
385
+ };
386
+ imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
387
+ const ret = arg0.buffer;
388
+ return ret;
389
+ };
390
+ imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) {
391
+ const ret = new Uint8Array(arg0);
392
+ return ret;
393
+ };
394
+ imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
395
+ arg0.set(arg1, arg2 >>> 0);
396
+ };
397
+ imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
398
+ const ret = arg0.length;
399
+ return ret;
400
+ };
401
+ imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
402
+ let result;
403
+ try {
404
+ result = arg0 instanceof Uint8Array;
405
+ } catch (_) {
406
+ result = false;
407
+ }
408
+ const ret = result;
409
+ return ret;
410
+ };
411
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
412
+ const v = arg1;
413
+ const ret = typeof(v) === 'bigint' ? v : undefined;
414
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
415
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
416
+ };
417
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
418
+ const ret = debugString(arg1);
419
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
420
+ const len1 = WASM_VECTOR_LEN;
421
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
422
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
423
+ };
424
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
425
+ throw new Error(getStringFromWasm0(arg0, arg1));
426
+ };
427
+ imports.wbg.__wbindgen_memory = function() {
428
+ const ret = wasm.memory;
429
+ return ret;
430
+ };
431
+ imports.wbg.__wbindgen_init_externref_table = function() {
432
+ const table = wasm.__wbindgen_export_2;
433
+ const offset = table.grow(4);
434
+ table.set(0, undefined);
435
+ table.set(offset + 0, undefined);
436
+ table.set(offset + 1, null);
437
+ table.set(offset + 2, true);
438
+ table.set(offset + 3, false);
439
+ ;
440
+ };
441
+
442
+ return imports;
443
+ }
444
+
445
+ function __wbg_init_memory(imports, memory) {
446
+
447
+ }
448
+
449
+ function __wbg_finalize_init(instance, module) {
450
+ wasm = instance.exports;
451
+ __wbg_init.__wbindgen_wasm_module = module;
452
+ cachedDataViewMemory0 = null;
453
+ cachedUint8ArrayMemory0 = null;
454
+
455
+
456
+ wasm.__wbindgen_start();
457
+ return wasm;
458
+ }
459
+
460
+ function initSync(module) {
461
+ if (wasm !== undefined) return wasm;
462
+
463
+
464
+ if (typeof module !== 'undefined') {
465
+ if (Object.getPrototypeOf(module) === Object.prototype) {
466
+ ({module} = module)
467
+ } else {
468
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
469
+ }
470
+ }
471
+
472
+ const imports = __wbg_get_imports();
473
+
474
+ __wbg_init_memory(imports);
475
+
476
+ if (!(module instanceof WebAssembly.Module)) {
477
+ module = new WebAssembly.Module(module);
478
+ }
479
+
480
+ const instance = new WebAssembly.Instance(module, imports);
481
+
482
+ return __wbg_finalize_init(instance, module);
483
+ }
484
+
485
+ async function __wbg_init(module_or_path) {
486
+ if (wasm !== undefined) return wasm;
487
+
488
+
489
+ if (typeof module_or_path !== 'undefined') {
490
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
491
+ ({module_or_path} = module_or_path)
492
+ } else {
493
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
494
+ }
495
+ }
496
+
497
+ if (typeof module_or_path === 'undefined') {
498
+ module_or_path = new URL('web_bg.wasm', import.meta.url);
499
+ }
500
+ const imports = __wbg_get_imports();
501
+
502
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
503
+ module_or_path = fetch(module_or_path);
504
+ }
505
+
506
+ __wbg_init_memory(imports);
507
+
508
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
509
+
510
+ return __wbg_finalize_init(instance, module);
511
+ }
512
+
513
+ export { initSync };
514
+ export default __wbg_init;
package/web_bg.wasm ADDED
Binary file
package/bundle.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * @param {any} obj
5
- * @param {string} path
6
- * @returns {any[]}
7
- */
8
- export function parse(obj: any, path: string): any[];
package/bundle.js DELETED
@@ -1,4 +0,0 @@
1
- import * as wasm from "./bundle_bg.wasm";
2
- export * from "./bundle_bg.js";
3
- import { __wbg_set_wasm } from "./bundle_bg.js";
4
- __wbg_set_wasm(wasm);
package/bundle_bg.js DELETED
@@ -1,480 +0,0 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let WASM_VECTOR_LEN = 0;
14
-
15
- let cachedUint8ArrayMemory0 = null;
16
-
17
- function getUint8ArrayMemory0() {
18
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
19
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
20
- }
21
- return cachedUint8ArrayMemory0;
22
- }
23
-
24
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
25
-
26
- let cachedTextEncoder = new lTextEncoder('utf-8');
27
-
28
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
29
- ? function (arg, view) {
30
- return cachedTextEncoder.encodeInto(arg, view);
31
- }
32
- : function (arg, view) {
33
- const buf = cachedTextEncoder.encode(arg);
34
- view.set(buf);
35
- return {
36
- read: arg.length,
37
- written: buf.length
38
- };
39
- });
40
-
41
- function passStringToWasm0(arg, malloc, realloc) {
42
-
43
- if (realloc === undefined) {
44
- const buf = cachedTextEncoder.encode(arg);
45
- const ptr = malloc(buf.length, 1) >>> 0;
46
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
47
- WASM_VECTOR_LEN = buf.length;
48
- return ptr;
49
- }
50
-
51
- let len = arg.length;
52
- let ptr = malloc(len, 1) >>> 0;
53
-
54
- const mem = getUint8ArrayMemory0();
55
-
56
- let offset = 0;
57
-
58
- for (; offset < len; offset++) {
59
- const code = arg.charCodeAt(offset);
60
- if (code > 0x7F) break;
61
- mem[ptr + offset] = code;
62
- }
63
-
64
- if (offset !== len) {
65
- if (offset !== 0) {
66
- arg = arg.slice(offset);
67
- }
68
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
69
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
70
- const ret = encodeString(arg, view);
71
-
72
- offset += ret.written;
73
- ptr = realloc(ptr, len, offset, 1) >>> 0;
74
- }
75
-
76
- WASM_VECTOR_LEN = offset;
77
- return ptr;
78
- }
79
-
80
- function isLikeNone(x) {
81
- return x === undefined || x === null;
82
- }
83
-
84
- let cachedDataViewMemory0 = null;
85
-
86
- function getDataViewMemory0() {
87
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
88
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
89
- }
90
- return cachedDataViewMemory0;
91
- }
92
-
93
- let heap_next = heap.length;
94
-
95
- function dropObject(idx) {
96
- if (idx < 132) return;
97
- heap[idx] = heap_next;
98
- heap_next = idx;
99
- }
100
-
101
- function takeObject(idx) {
102
- const ret = getObject(idx);
103
- dropObject(idx);
104
- return ret;
105
- }
106
-
107
- function addHeapObject(obj) {
108
- if (heap_next === heap.length) heap.push(heap.length + 1);
109
- const idx = heap_next;
110
- heap_next = heap[idx];
111
-
112
- heap[idx] = obj;
113
- return idx;
114
- }
115
-
116
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
117
-
118
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
119
-
120
- cachedTextDecoder.decode();
121
-
122
- function getStringFromWasm0(ptr, len) {
123
- ptr = ptr >>> 0;
124
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
125
- }
126
-
127
- function debugString(val) {
128
- // primitive types
129
- const type = typeof val;
130
- if (type == 'number' || type == 'boolean' || val == null) {
131
- return `${val}`;
132
- }
133
- if (type == 'string') {
134
- return `"${val}"`;
135
- }
136
- if (type == 'symbol') {
137
- const description = val.description;
138
- if (description == null) {
139
- return 'Symbol';
140
- } else {
141
- return `Symbol(${description})`;
142
- }
143
- }
144
- if (type == 'function') {
145
- const name = val.name;
146
- if (typeof name == 'string' && name.length > 0) {
147
- return `Function(${name})`;
148
- } else {
149
- return 'Function';
150
- }
151
- }
152
- // objects
153
- if (Array.isArray(val)) {
154
- const length = val.length;
155
- let debug = '[';
156
- if (length > 0) {
157
- debug += debugString(val[0]);
158
- }
159
- for(let i = 1; i < length; i++) {
160
- debug += ', ' + debugString(val[i]);
161
- }
162
- debug += ']';
163
- return debug;
164
- }
165
- // Test for built-in
166
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
167
- let className;
168
- if (builtInMatches.length > 1) {
169
- className = builtInMatches[1];
170
- } else {
171
- // Failed to match the standard '[object ClassName]'
172
- return toString.call(val);
173
- }
174
- if (className == 'Object') {
175
- // we're a user defined class or Object
176
- // JSON.stringify avoids problems with cycles, and is generally much
177
- // easier than looping through ownProperties of `val`.
178
- try {
179
- return 'Object(' + JSON.stringify(val) + ')';
180
- } catch (_) {
181
- return 'Object';
182
- }
183
- }
184
- // errors
185
- if (val instanceof Error) {
186
- return `${val.name}: ${val.message}\n${val.stack}`;
187
- }
188
- // TODO we could test for more things here, like `Set`s and `Map`s.
189
- return className;
190
- }
191
-
192
- function getArrayJsValueFromWasm0(ptr, len) {
193
- ptr = ptr >>> 0;
194
- const mem = getDataViewMemory0();
195
- const result = [];
196
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
197
- result.push(takeObject(mem.getUint32(i, true)));
198
- }
199
- return result;
200
- }
201
- /**
202
- * @param {any} obj
203
- * @param {string} path
204
- * @returns {any[]}
205
- */
206
- export function parse(obj, path) {
207
- try {
208
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
209
- const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
210
- const len0 = WASM_VECTOR_LEN;
211
- wasm.parse(retptr, addHeapObject(obj), ptr0, len0);
212
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
213
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
214
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
215
- wasm.__wbindgen_free(r0, r1 * 4, 4);
216
- return v2;
217
- } finally {
218
- wasm.__wbindgen_add_to_stack_pointer(16);
219
- }
220
- }
221
-
222
- function handleError(f, args) {
223
- try {
224
- return f.apply(this, args);
225
- } catch (e) {
226
- wasm.__wbindgen_exn_store(addHeapObject(e));
227
- }
228
- }
229
-
230
- export function __wbindgen_string_get(arg0, arg1) {
231
- const obj = getObject(arg1);
232
- const ret = typeof(obj) === 'string' ? obj : undefined;
233
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
234
- var len1 = WASM_VECTOR_LEN;
235
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
236
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
237
- };
238
-
239
- export function __wbindgen_object_drop_ref(arg0) {
240
- takeObject(arg0);
241
- };
242
-
243
- export function __wbindgen_boolean_get(arg0) {
244
- const v = getObject(arg0);
245
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
246
- return ret;
247
- };
248
-
249
- export function __wbindgen_is_bigint(arg0) {
250
- const ret = typeof(getObject(arg0)) === 'bigint';
251
- return ret;
252
- };
253
-
254
- export function __wbindgen_number_get(arg0, arg1) {
255
- const obj = getObject(arg1);
256
- const ret = typeof(obj) === 'number' ? obj : undefined;
257
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
258
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
259
- };
260
-
261
- export function __wbindgen_is_object(arg0) {
262
- const val = getObject(arg0);
263
- const ret = typeof(val) === 'object' && val !== null;
264
- return ret;
265
- };
266
-
267
- export function __wbindgen_in(arg0, arg1) {
268
- const ret = getObject(arg0) in getObject(arg1);
269
- return ret;
270
- };
271
-
272
- export function __wbindgen_bigint_from_i64(arg0) {
273
- const ret = arg0;
274
- return addHeapObject(ret);
275
- };
276
-
277
- export function __wbindgen_jsval_eq(arg0, arg1) {
278
- const ret = getObject(arg0) === getObject(arg1);
279
- return ret;
280
- };
281
-
282
- export function __wbindgen_bigint_from_u64(arg0) {
283
- const ret = BigInt.asUintN(64, arg0);
284
- return addHeapObject(ret);
285
- };
286
-
287
- export function __wbindgen_error_new(arg0, arg1) {
288
- const ret = new Error(getStringFromWasm0(arg0, arg1));
289
- return addHeapObject(ret);
290
- };
291
-
292
- export function __wbindgen_is_string(arg0) {
293
- const ret = typeof(getObject(arg0)) === 'string';
294
- return ret;
295
- };
296
-
297
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
298
- const ret = getObject(arg0) == getObject(arg1);
299
- return ret;
300
- };
301
-
302
- export function __wbindgen_number_new(arg0) {
303
- const ret = arg0;
304
- return addHeapObject(ret);
305
- };
306
-
307
- export function __wbindgen_string_new(arg0, arg1) {
308
- const ret = getStringFromWasm0(arg0, arg1);
309
- return addHeapObject(ret);
310
- };
311
-
312
- export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
313
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
314
- };
315
-
316
- export function __wbg_get_5419cf6b954aa11d(arg0, arg1) {
317
- const ret = getObject(arg0)[arg1 >>> 0];
318
- return addHeapObject(ret);
319
- };
320
-
321
- export function __wbg_length_f217bbbf7e8e4df4(arg0) {
322
- const ret = getObject(arg0).length;
323
- return ret;
324
- };
325
-
326
- export function __wbg_new_034f913e7636e987() {
327
- const ret = new Array();
328
- return addHeapObject(ret);
329
- };
330
-
331
- export function __wbindgen_is_function(arg0) {
332
- const ret = typeof(getObject(arg0)) === 'function';
333
- return ret;
334
- };
335
-
336
- export function __wbg_new_7a87a0376e40533b() {
337
- const ret = new Map();
338
- return addHeapObject(ret);
339
- };
340
-
341
- export function __wbg_next_13b477da1eaa3897(arg0) {
342
- const ret = getObject(arg0).next;
343
- return addHeapObject(ret);
344
- };
345
-
346
- export function __wbg_next_b06e115d1b01e10b() { return handleError(function (arg0) {
347
- const ret = getObject(arg0).next();
348
- return addHeapObject(ret);
349
- }, arguments) };
350
-
351
- export function __wbg_done_983b5ffcaec8c583(arg0) {
352
- const ret = getObject(arg0).done;
353
- return ret;
354
- };
355
-
356
- export function __wbg_value_2ab8a198c834c26a(arg0) {
357
- const ret = getObject(arg0).value;
358
- return addHeapObject(ret);
359
- };
360
-
361
- export function __wbg_iterator_695d699a44d6234c() {
362
- const ret = Symbol.iterator;
363
- return addHeapObject(ret);
364
- };
365
-
366
- export function __wbg_get_ef828680c64da212() { return handleError(function (arg0, arg1) {
367
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
368
- return addHeapObject(ret);
369
- }, arguments) };
370
-
371
- export function __wbg_call_a9ef466721e824f2() { return handleError(function (arg0, arg1) {
372
- const ret = getObject(arg0).call(getObject(arg1));
373
- return addHeapObject(ret);
374
- }, arguments) };
375
-
376
- export function __wbg_new_e69b5f66fda8f13c() {
377
- const ret = new Object();
378
- return addHeapObject(ret);
379
- };
380
-
381
- export function __wbg_set_425e70f7c64ac962(arg0, arg1, arg2) {
382
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
383
- };
384
-
385
- export function __wbg_isArray_6f3b47f09adb61b5(arg0) {
386
- const ret = Array.isArray(getObject(arg0));
387
- return ret;
388
- };
389
-
390
- export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
391
- let result;
392
- try {
393
- result = getObject(arg0) instanceof ArrayBuffer;
394
- } catch (_) {
395
- result = false;
396
- }
397
- const ret = result;
398
- return ret;
399
- };
400
-
401
- export function __wbg_instanceof_Map_f96986929e7e89ed(arg0) {
402
- let result;
403
- try {
404
- result = getObject(arg0) instanceof Map;
405
- } catch (_) {
406
- result = false;
407
- }
408
- const ret = result;
409
- return ret;
410
- };
411
-
412
- export function __wbg_set_277a63e77c89279f(arg0, arg1, arg2) {
413
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
414
- return addHeapObject(ret);
415
- };
416
-
417
- export function __wbg_isSafeInteger_b9dff570f01a9100(arg0) {
418
- const ret = Number.isSafeInteger(getObject(arg0));
419
- return ret;
420
- };
421
-
422
- export function __wbg_entries_c02034de337d3ee2(arg0) {
423
- const ret = Object.entries(getObject(arg0));
424
- return addHeapObject(ret);
425
- };
426
-
427
- export function __wbg_buffer_ccaed51a635d8a2d(arg0) {
428
- const ret = getObject(arg0).buffer;
429
- return addHeapObject(ret);
430
- };
431
-
432
- export function __wbg_new_fec2611eb9180f95(arg0) {
433
- const ret = new Uint8Array(getObject(arg0));
434
- return addHeapObject(ret);
435
- };
436
-
437
- export function __wbg_set_ec2fcf81bc573fd9(arg0, arg1, arg2) {
438
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
439
- };
440
-
441
- export function __wbg_length_9254c4bd3b9f23c4(arg0) {
442
- const ret = getObject(arg0).length;
443
- return ret;
444
- };
445
-
446
- export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
447
- let result;
448
- try {
449
- result = getObject(arg0) instanceof Uint8Array;
450
- } catch (_) {
451
- result = false;
452
- }
453
- const ret = result;
454
- return ret;
455
- };
456
-
457
- export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
458
- const v = getObject(arg1);
459
- const ret = typeof(v) === 'bigint' ? v : undefined;
460
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
461
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
462
- };
463
-
464
- export function __wbindgen_debug_string(arg0, arg1) {
465
- const ret = debugString(getObject(arg1));
466
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
- const len1 = WASM_VECTOR_LEN;
468
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
469
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
470
- };
471
-
472
- export function __wbindgen_throw(arg0, arg1) {
473
- throw new Error(getStringFromWasm0(arg0, arg1));
474
- };
475
-
476
- export function __wbindgen_memory() {
477
- const ret = wasm.memory;
478
- return addHeapObject(ret);
479
- };
480
-
package/bundle_bg.wasm DELETED
Binary file