jsontrek 0.1.9 → 0.1.11

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/bundle.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as wasm from "./bundle_bg.wasm";
2
2
  export * from "./bundle_bg.js";
3
3
  import { __wbg_set_wasm } from "./bundle_bg.js";
4
- __wbg_set_wasm(wasm);
4
+ __wbg_set_wasm(wasm);
5
+ wasm.__wbindgen_start();
package/bundle_bg.js CHANGED
@@ -4,12 +4,6 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
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
7
  let WASM_VECTOR_LEN = 0;
14
8
 
15
9
  let cachedUint8ArrayMemory0 = null;
@@ -90,29 +84,6 @@ function getDataViewMemory0() {
90
84
  return cachedDataViewMemory0;
91
85
  }
92
86
 
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
87
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
117
88
 
118
89
  let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -194,8 +165,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
194
165
  const mem = getDataViewMemory0();
195
166
  const result = [];
196
167
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
197
- result.push(takeObject(mem.getUint32(i, true)));
168
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
198
169
  }
170
+ wasm.__externref_drop_slice(ptr, len);
199
171
  return result;
200
172
  }
201
173
  /**
@@ -204,31 +176,31 @@ function getArrayJsValueFromWasm0(ptr, len) {
204
176
  * @returns {any[]}
205
177
  */
206
178
  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
- }
179
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
180
+ const len0 = WASM_VECTOR_LEN;
181
+ const ret = wasm.parse(obj, ptr0, len0);
182
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
183
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
184
+ return v2;
185
+ }
186
+
187
+ function addToExternrefTable0(obj) {
188
+ const idx = wasm.__externref_table_alloc();
189
+ wasm.__wbindgen_export_2.set(idx, obj);
190
+ return idx;
220
191
  }
221
192
 
222
193
  function handleError(f, args) {
223
194
  try {
224
195
  return f.apply(this, args);
225
196
  } catch (e) {
226
- wasm.__wbindgen_exn_store(addHeapObject(e));
197
+ const idx = addToExternrefTable0(e);
198
+ wasm.__wbindgen_exn_store(idx);
227
199
  }
228
200
  }
229
201
 
230
202
  export function __wbindgen_string_get(arg0, arg1) {
231
- const obj = getObject(arg1);
203
+ const obj = arg1;
232
204
  const ret = typeof(obj) === 'string' ? obj : undefined;
233
205
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
234
206
  var len1 = WASM_VECTOR_LEN;
@@ -236,161 +208,157 @@ export function __wbindgen_string_get(arg0, arg1) {
236
208
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
237
209
  };
238
210
 
239
- export function __wbindgen_object_drop_ref(arg0) {
240
- takeObject(arg0);
241
- };
242
-
243
211
  export function __wbindgen_boolean_get(arg0) {
244
- const v = getObject(arg0);
212
+ const v = arg0;
245
213
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
246
214
  return ret;
247
215
  };
248
216
 
249
217
  export function __wbindgen_is_bigint(arg0) {
250
- const ret = typeof(getObject(arg0)) === 'bigint';
218
+ const ret = typeof(arg0) === 'bigint';
251
219
  return ret;
252
220
  };
253
221
 
254
222
  export function __wbindgen_number_get(arg0, arg1) {
255
- const obj = getObject(arg1);
223
+ const obj = arg1;
256
224
  const ret = typeof(obj) === 'number' ? obj : undefined;
257
225
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
258
226
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
259
227
  };
260
228
 
261
229
  export function __wbindgen_is_object(arg0) {
262
- const val = getObject(arg0);
230
+ const val = arg0;
263
231
  const ret = typeof(val) === 'object' && val !== null;
264
232
  return ret;
265
233
  };
266
234
 
267
235
  export function __wbindgen_in(arg0, arg1) {
268
- const ret = getObject(arg0) in getObject(arg1);
236
+ const ret = arg0 in arg1;
269
237
  return ret;
270
238
  };
271
239
 
272
240
  export function __wbindgen_bigint_from_i64(arg0) {
273
241
  const ret = arg0;
274
- return addHeapObject(ret);
242
+ return ret;
275
243
  };
276
244
 
277
245
  export function __wbindgen_jsval_eq(arg0, arg1) {
278
- const ret = getObject(arg0) === getObject(arg1);
246
+ const ret = arg0 === arg1;
279
247
  return ret;
280
248
  };
281
249
 
282
250
  export function __wbindgen_bigint_from_u64(arg0) {
283
251
  const ret = BigInt.asUintN(64, arg0);
284
- return addHeapObject(ret);
252
+ return ret;
285
253
  };
286
254
 
287
255
  export function __wbindgen_error_new(arg0, arg1) {
288
256
  const ret = new Error(getStringFromWasm0(arg0, arg1));
289
- return addHeapObject(ret);
257
+ return ret;
290
258
  };
291
259
 
292
260
  export function __wbindgen_is_string(arg0) {
293
- const ret = typeof(getObject(arg0)) === 'string';
261
+ const ret = typeof(arg0) === 'string';
294
262
  return ret;
295
263
  };
296
264
 
297
265
  export function __wbindgen_jsval_loose_eq(arg0, arg1) {
298
- const ret = getObject(arg0) == getObject(arg1);
266
+ const ret = arg0 == arg1;
299
267
  return ret;
300
268
  };
301
269
 
302
270
  export function __wbindgen_number_new(arg0) {
303
271
  const ret = arg0;
304
- return addHeapObject(ret);
272
+ return ret;
305
273
  };
306
274
 
307
275
  export function __wbindgen_string_new(arg0, arg1) {
308
276
  const ret = getStringFromWasm0(arg0, arg1);
309
- return addHeapObject(ret);
277
+ return ret;
310
278
  };
311
279
 
312
280
  export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
313
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
281
+ arg0[arg1] = arg2;
314
282
  };
315
283
 
316
284
  export function __wbg_get_5419cf6b954aa11d(arg0, arg1) {
317
- const ret = getObject(arg0)[arg1 >>> 0];
318
- return addHeapObject(ret);
285
+ const ret = arg0[arg1 >>> 0];
286
+ return ret;
319
287
  };
320
288
 
321
289
  export function __wbg_length_f217bbbf7e8e4df4(arg0) {
322
- const ret = getObject(arg0).length;
290
+ const ret = arg0.length;
323
291
  return ret;
324
292
  };
325
293
 
326
294
  export function __wbg_new_034f913e7636e987() {
327
295
  const ret = new Array();
328
- return addHeapObject(ret);
296
+ return ret;
329
297
  };
330
298
 
331
299
  export function __wbindgen_is_function(arg0) {
332
- const ret = typeof(getObject(arg0)) === 'function';
300
+ const ret = typeof(arg0) === 'function';
333
301
  return ret;
334
302
  };
335
303
 
336
304
  export function __wbg_new_7a87a0376e40533b() {
337
305
  const ret = new Map();
338
- return addHeapObject(ret);
306
+ return ret;
339
307
  };
340
308
 
341
309
  export function __wbg_next_13b477da1eaa3897(arg0) {
342
- const ret = getObject(arg0).next;
343
- return addHeapObject(ret);
310
+ const ret = arg0.next;
311
+ return ret;
344
312
  };
345
313
 
346
314
  export function __wbg_next_b06e115d1b01e10b() { return handleError(function (arg0) {
347
- const ret = getObject(arg0).next();
348
- return addHeapObject(ret);
315
+ const ret = arg0.next();
316
+ return ret;
349
317
  }, arguments) };
350
318
 
351
319
  export function __wbg_done_983b5ffcaec8c583(arg0) {
352
- const ret = getObject(arg0).done;
320
+ const ret = arg0.done;
353
321
  return ret;
354
322
  };
355
323
 
356
324
  export function __wbg_value_2ab8a198c834c26a(arg0) {
357
- const ret = getObject(arg0).value;
358
- return addHeapObject(ret);
325
+ const ret = arg0.value;
326
+ return ret;
359
327
  };
360
328
 
361
329
  export function __wbg_iterator_695d699a44d6234c() {
362
330
  const ret = Symbol.iterator;
363
- return addHeapObject(ret);
331
+ return ret;
364
332
  };
365
333
 
366
334
  export function __wbg_get_ef828680c64da212() { return handleError(function (arg0, arg1) {
367
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
368
- return addHeapObject(ret);
335
+ const ret = Reflect.get(arg0, arg1);
336
+ return ret;
369
337
  }, arguments) };
370
338
 
371
339
  export function __wbg_call_a9ef466721e824f2() { return handleError(function (arg0, arg1) {
372
- const ret = getObject(arg0).call(getObject(arg1));
373
- return addHeapObject(ret);
340
+ const ret = arg0.call(arg1);
341
+ return ret;
374
342
  }, arguments) };
375
343
 
376
344
  export function __wbg_new_e69b5f66fda8f13c() {
377
345
  const ret = new Object();
378
- return addHeapObject(ret);
346
+ return ret;
379
347
  };
380
348
 
381
349
  export function __wbg_set_425e70f7c64ac962(arg0, arg1, arg2) {
382
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
350
+ arg0[arg1 >>> 0] = arg2;
383
351
  };
384
352
 
385
353
  export function __wbg_isArray_6f3b47f09adb61b5(arg0) {
386
- const ret = Array.isArray(getObject(arg0));
354
+ const ret = Array.isArray(arg0);
387
355
  return ret;
388
356
  };
389
357
 
390
358
  export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
391
359
  let result;
392
360
  try {
393
- result = getObject(arg0) instanceof ArrayBuffer;
361
+ result = arg0 instanceof ArrayBuffer;
394
362
  } catch (_) {
395
363
  result = false;
396
364
  }
@@ -401,7 +369,7 @@ export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
401
369
  export function __wbg_instanceof_Map_f96986929e7e89ed(arg0) {
402
370
  let result;
403
371
  try {
404
- result = getObject(arg0) instanceof Map;
372
+ result = arg0 instanceof Map;
405
373
  } catch (_) {
406
374
  result = false;
407
375
  }
@@ -410,43 +378,43 @@ export function __wbg_instanceof_Map_f96986929e7e89ed(arg0) {
410
378
  };
411
379
 
412
380
  export function __wbg_set_277a63e77c89279f(arg0, arg1, arg2) {
413
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
414
- return addHeapObject(ret);
381
+ const ret = arg0.set(arg1, arg2);
382
+ return ret;
415
383
  };
416
384
 
417
385
  export function __wbg_isSafeInteger_b9dff570f01a9100(arg0) {
418
- const ret = Number.isSafeInteger(getObject(arg0));
386
+ const ret = Number.isSafeInteger(arg0);
419
387
  return ret;
420
388
  };
421
389
 
422
390
  export function __wbg_entries_c02034de337d3ee2(arg0) {
423
- const ret = Object.entries(getObject(arg0));
424
- return addHeapObject(ret);
391
+ const ret = Object.entries(arg0);
392
+ return ret;
425
393
  };
426
394
 
427
395
  export function __wbg_buffer_ccaed51a635d8a2d(arg0) {
428
- const ret = getObject(arg0).buffer;
429
- return addHeapObject(ret);
396
+ const ret = arg0.buffer;
397
+ return ret;
430
398
  };
431
399
 
432
400
  export function __wbg_new_fec2611eb9180f95(arg0) {
433
- const ret = new Uint8Array(getObject(arg0));
434
- return addHeapObject(ret);
401
+ const ret = new Uint8Array(arg0);
402
+ return ret;
435
403
  };
436
404
 
437
405
  export function __wbg_set_ec2fcf81bc573fd9(arg0, arg1, arg2) {
438
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
406
+ arg0.set(arg1, arg2 >>> 0);
439
407
  };
440
408
 
441
409
  export function __wbg_length_9254c4bd3b9f23c4(arg0) {
442
- const ret = getObject(arg0).length;
410
+ const ret = arg0.length;
443
411
  return ret;
444
412
  };
445
413
 
446
414
  export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
447
415
  let result;
448
416
  try {
449
- result = getObject(arg0) instanceof Uint8Array;
417
+ result = arg0 instanceof Uint8Array;
450
418
  } catch (_) {
451
419
  result = false;
452
420
  }
@@ -455,14 +423,14 @@ export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
455
423
  };
456
424
 
457
425
  export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
458
- const v = getObject(arg1);
426
+ const v = arg1;
459
427
  const ret = typeof(v) === 'bigint' ? v : undefined;
460
428
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
461
429
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
462
430
  };
463
431
 
464
432
  export function __wbindgen_debug_string(arg0, arg1) {
465
- const ret = debugString(getObject(arg1));
433
+ const ret = debugString(arg1);
466
434
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
435
  const len1 = WASM_VECTOR_LEN;
468
436
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -475,6 +443,17 @@ export function __wbindgen_throw(arg0, arg1) {
475
443
 
476
444
  export function __wbindgen_memory() {
477
445
  const ret = wasm.memory;
478
- return addHeapObject(ret);
446
+ return ret;
447
+ };
448
+
449
+ export function __wbindgen_init_externref_table() {
450
+ const table = wasm.__wbindgen_export_2;
451
+ const offset = table.grow(4);
452
+ table.set(0, undefined);
453
+ table.set(offset + 0, undefined);
454
+ table.set(offset + 1, null);
455
+ table.set(offset + 2, true);
456
+ table.set(offset + 3, false);
457
+ ;
479
458
  };
480
459
 
package/bundle_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jsontrek",
3
3
  "type": "module",
4
- "version": "0.1.9",
4
+ "version": "0.1.11",
5
5
  "files": [
6
6
  "bundle_bg.wasm",
7
7
  "bundle.js",