@blaze-cache/core 0.3.0-beta.1 → 0.4.0-beta.0
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 +53 -6
- package/dist/cache.d.ts +72 -1
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +121 -4
- package/dist/cache.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +5 -0
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/reactivity.d.ts +63 -0
- package/dist/reactivity.d.ts.map +1 -0
- package/dist/reactivity.js +424 -0
- package/dist/reactivity.js.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wasm.d.ts +45 -0
- package/dist/wasm.d.ts.map +1 -1
- package/dist/wasm.js +107 -3
- package/dist/wasm.js.map +1 -1
- package/package.json +1 -1
- package/pkg/blaze_cache_wasm.d.ts +59 -8
- package/pkg/blaze_cache_wasm.js +222 -135
- package/pkg/blaze_cache_wasm_bg.wasm +0 -0
- package/pkg/blaze_cache_wasm_bg.wasm.d.ts +16 -7
- package/pkg/package.json +1 -1
package/pkg/blaze_cache_wasm.js
CHANGED
|
@@ -35,7 +35,7 @@ export class BlazeCache {
|
|
|
35
35
|
*/
|
|
36
36
|
deleteMany(keys) {
|
|
37
37
|
try {
|
|
38
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
38
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
39
39
|
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
40
40
|
const len0 = WASM_VECTOR_LEN;
|
|
41
41
|
wasm.blazecache_deleteMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -48,6 +48,17 @@ export class BlazeCache {
|
|
|
48
48
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* [`delete`](Self::delete) with a pre-encoded key. See [`getRaw`](Self::get_raw) for
|
|
53
|
+
* the host contract.
|
|
54
|
+
* @param {number} ptr
|
|
55
|
+
* @param {number} len
|
|
56
|
+
* @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
deleteRaw(ptr, len) {
|
|
59
|
+
const ret = wasm.blazecache_deleteRaw(this.__wbg_ptr, ptr, len);
|
|
60
|
+
return ret !== 0;
|
|
61
|
+
}
|
|
51
62
|
/**
|
|
52
63
|
* Removes `key`, returning whether it was there.
|
|
53
64
|
* @param {string} key
|
|
@@ -71,7 +82,7 @@ export class BlazeCache {
|
|
|
71
82
|
*/
|
|
72
83
|
drainDrops() {
|
|
73
84
|
const ret = wasm.blazecache_drainDrops(this.__wbg_ptr);
|
|
74
|
-
return
|
|
85
|
+
return ret;
|
|
75
86
|
}
|
|
76
87
|
/**
|
|
77
88
|
* `true` while the drop log is being collected.
|
|
@@ -90,7 +101,7 @@ export class BlazeCache {
|
|
|
90
101
|
*/
|
|
91
102
|
entries() {
|
|
92
103
|
const ret = wasm.blazecache_entries(this.__wbg_ptr);
|
|
93
|
-
return
|
|
104
|
+
return ret;
|
|
94
105
|
}
|
|
95
106
|
/**
|
|
96
107
|
* Full view of one key — value, remaining TTL (ms) and tags — or `undefined` when the key
|
|
@@ -102,7 +113,7 @@ export class BlazeCache {
|
|
|
102
113
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
103
114
|
const len0 = WASM_VECTOR_LEN;
|
|
104
115
|
const ret = wasm.blazecache_entry(this.__wbg_ptr, ptr0, len0);
|
|
105
|
-
return
|
|
116
|
+
return ret;
|
|
106
117
|
}
|
|
107
118
|
/**
|
|
108
119
|
* Batch get: looks up every key in one boundary crossing. Returns `JsValue::UNDEFINED`
|
|
@@ -112,7 +123,7 @@ export class BlazeCache {
|
|
|
112
123
|
*/
|
|
113
124
|
getMany(keys) {
|
|
114
125
|
try {
|
|
115
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
126
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
116
127
|
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
117
128
|
const len0 = WASM_VECTOR_LEN;
|
|
118
129
|
wasm.blazecache_getMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -125,6 +136,27 @@ export class BlazeCache {
|
|
|
125
136
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
126
137
|
}
|
|
127
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* [`get`](Self::get) with the key already encoded into wasm memory by the host.
|
|
141
|
+
*
|
|
142
|
+
* The TypeScript wrapper encodes each distinct key once into the shared scratch (see
|
|
143
|
+
* [`ensureScratch`]) and passes the offset/length, so a repeat lookup costs no
|
|
144
|
+
* `passStringToWasm0` allocation — that malloc + copy + free was the single largest
|
|
145
|
+
* component of a read.
|
|
146
|
+
*
|
|
147
|
+
* # Host contract
|
|
148
|
+
*
|
|
149
|
+
* `ptr`/`len` must address `len` bytes of valid UTF-8. The wrapper only ever passes
|
|
150
|
+
* bytes it encoded from a JS string (ASCII fast path or `TextEncoder`), so the slice
|
|
151
|
+
* below is valid by construction.
|
|
152
|
+
* @param {number} ptr
|
|
153
|
+
* @param {number} len
|
|
154
|
+
* @returns {any | undefined}
|
|
155
|
+
*/
|
|
156
|
+
getRaw(ptr, len) {
|
|
157
|
+
const ret = wasm.blazecache_getRaw(this.__wbg_ptr, ptr, len);
|
|
158
|
+
return ret;
|
|
159
|
+
}
|
|
128
160
|
/**
|
|
129
161
|
* Returns the value stored under `key`, or `undefined` when it is missing/expired.
|
|
130
162
|
*
|
|
@@ -136,7 +168,7 @@ export class BlazeCache {
|
|
|
136
168
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
137
169
|
const len0 = WASM_VECTOR_LEN;
|
|
138
170
|
const ret = wasm.blazecache_get(this.__wbg_ptr, ptr0, len0);
|
|
139
|
-
return
|
|
171
|
+
return ret;
|
|
140
172
|
}
|
|
141
173
|
/**
|
|
142
174
|
* Batch has: returns `1` for each key that is present and not expired, `0` otherwise.
|
|
@@ -145,7 +177,7 @@ export class BlazeCache {
|
|
|
145
177
|
*/
|
|
146
178
|
hasMany(keys) {
|
|
147
179
|
try {
|
|
148
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
180
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
149
181
|
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
150
182
|
const len0 = WASM_VECTOR_LEN;
|
|
151
183
|
wasm.blazecache_hasMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -165,10 +197,17 @@ export class BlazeCache {
|
|
|
165
197
|
* @returns {boolean}
|
|
166
198
|
*/
|
|
167
199
|
hasTag(key, tag) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
200
|
+
let ptr0, len0, ptr1, len1;
|
|
201
|
+
try {
|
|
202
|
+
ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
203
|
+
len0 = WASM_VECTOR_LEN;
|
|
204
|
+
ptr1 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
205
|
+
len1 = WASM_VECTOR_LEN;
|
|
206
|
+
} catch (e) {
|
|
207
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
208
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
172
211
|
const ret = wasm.blazecache_hasTag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
173
212
|
return ret !== 0;
|
|
174
213
|
}
|
|
@@ -191,7 +230,7 @@ export class BlazeCache {
|
|
|
191
230
|
*/
|
|
192
231
|
invalidateTags(tags) {
|
|
193
232
|
try {
|
|
194
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
233
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
195
234
|
const ptr0 = passArrayJsValueToWasm0(tags, wasm.__wbindgen_export);
|
|
196
235
|
const len0 = WASM_VECTOR_LEN;
|
|
197
236
|
wasm.blazecache_invalidateTags(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -211,7 +250,7 @@ export class BlazeCache {
|
|
|
211
250
|
*/
|
|
212
251
|
keysWithTag(tag) {
|
|
213
252
|
try {
|
|
214
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
253
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
215
254
|
const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
216
255
|
const len0 = WASM_VECTOR_LEN;
|
|
217
256
|
wasm.blazecache_keysWithTag(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -230,7 +269,7 @@ export class BlazeCache {
|
|
|
230
269
|
*/
|
|
231
270
|
keys() {
|
|
232
271
|
try {
|
|
233
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
234
273
|
wasm.blazecache_keys(retptr, this.__wbg_ptr);
|
|
235
274
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
236
275
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
@@ -275,7 +314,7 @@ export class BlazeCache {
|
|
|
275
314
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
276
315
|
const len0 = WASM_VECTOR_LEN;
|
|
277
316
|
const ret = wasm.blazecache_peek(this.__wbg_ptr, ptr0, len0);
|
|
278
|
-
return
|
|
317
|
+
return ret;
|
|
279
318
|
}
|
|
280
319
|
/**
|
|
281
320
|
* Removes every expired entry, returning the removed keys.
|
|
@@ -283,7 +322,7 @@ export class BlazeCache {
|
|
|
283
322
|
*/
|
|
284
323
|
prune() {
|
|
285
324
|
try {
|
|
286
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
325
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
287
326
|
wasm.blazecache_prune(retptr, this.__wbg_ptr);
|
|
288
327
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
328
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
@@ -322,20 +361,41 @@ export class BlazeCache {
|
|
|
322
361
|
* for that entry instead of panicking and trapping the wasm instance.
|
|
323
362
|
* @param {string[]} keys
|
|
324
363
|
* @param {any} values
|
|
325
|
-
* @param {Float64Array} ttl_ms
|
|
364
|
+
* @param {Float64Array | number[]} ttl_ms
|
|
326
365
|
* @param {string[]} tags_flat
|
|
327
|
-
* @param {Uint32Array} tag_offsets
|
|
366
|
+
* @param {Uint32Array | number[]} tag_offsets
|
|
328
367
|
*/
|
|
329
368
|
setMany(keys, values, ttl_ms, tags_flat, tag_offsets) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
369
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
370
|
+
try {
|
|
371
|
+
ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
372
|
+
len0 = WASM_VECTOR_LEN;
|
|
373
|
+
ptr1 = passArrayF64ToWasm0(ttl_ms, wasm.__wbindgen_export);
|
|
374
|
+
len1 = WASM_VECTOR_LEN;
|
|
375
|
+
ptr2 = passArrayJsValueToWasm0(tags_flat, wasm.__wbindgen_export);
|
|
376
|
+
len2 = WASM_VECTOR_LEN;
|
|
377
|
+
ptr3 = passArray32ToWasm0(tag_offsets, wasm.__wbindgen_export);
|
|
378
|
+
len3 = WASM_VECTOR_LEN;
|
|
379
|
+
} catch (e) {
|
|
380
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 4, 4); }
|
|
381
|
+
if (ptr2) { wasm.__wbindgen_export6(ptr2, len2); wasm.__wbindgen_export3(ptr2, len2 * 4, 4); }
|
|
382
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 8, 8); }
|
|
383
|
+
if (ptr0) { wasm.__wbindgen_export6(ptr0, len0); wasm.__wbindgen_export3(ptr0, len0 * 4, 4); }
|
|
384
|
+
throw e;
|
|
385
|
+
}
|
|
386
|
+
wasm.blazecache_setMany(this.__wbg_ptr, ptr0, len0, values, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* [`set`](Self::set) with a pre-encoded key and **no tags** — the untagged write fast
|
|
390
|
+
* path. Untagged writes skip the `Vec<String>` boundary crossing entirely; use
|
|
391
|
+
* [`set`](Self::set) when the entry carries tags.
|
|
392
|
+
* @param {number} ptr
|
|
393
|
+
* @param {number} len
|
|
394
|
+
* @param {any} value
|
|
395
|
+
* @param {number | null} [ttl_ms]
|
|
396
|
+
*/
|
|
397
|
+
setRaw(ptr, len, value, ttl_ms) {
|
|
398
|
+
wasm.blazecache_setRaw(this.__wbg_ptr, ptr, len, value, !isLikeNone(ttl_ms), isLikeNone(ttl_ms) ? 0 : ttl_ms);
|
|
339
399
|
}
|
|
340
400
|
/**
|
|
341
401
|
* Stores `value` under `key`.
|
|
@@ -353,11 +413,19 @@ export class BlazeCache {
|
|
|
353
413
|
* @param {string[]} tags
|
|
354
414
|
*/
|
|
355
415
|
set(key, value, ttl_ms, tags) {
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
416
|
+
const val3 = +(isLikeNone(ttl_ms) ? 0 : ttl_ms);
|
|
417
|
+
let ptr0, len0, ptr1, len1;
|
|
418
|
+
try {
|
|
419
|
+
ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
420
|
+
len0 = WASM_VECTOR_LEN;
|
|
421
|
+
ptr1 = passArrayJsValueToWasm0(tags, wasm.__wbindgen_export);
|
|
422
|
+
len1 = WASM_VECTOR_LEN;
|
|
423
|
+
} catch (e) {
|
|
424
|
+
if (ptr1) { wasm.__wbindgen_export6(ptr1, len1); wasm.__wbindgen_export3(ptr1, len1 * 4, 4); }
|
|
425
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
426
|
+
throw e;
|
|
427
|
+
}
|
|
428
|
+
wasm.blazecache_set(this.__wbg_ptr, ptr0, len0, value, !isLikeNone(ttl_ms), val3, ptr1, len1);
|
|
361
429
|
}
|
|
362
430
|
/**
|
|
363
431
|
* Number of stored entries that are present **and** not expired — expired-but-unpruned
|
|
@@ -376,15 +444,15 @@ export class BlazeCache {
|
|
|
376
444
|
*/
|
|
377
445
|
stats() {
|
|
378
446
|
try {
|
|
379
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
447
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
380
448
|
wasm.blazecache_stats(retptr, this.__wbg_ptr);
|
|
381
449
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
382
450
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
383
451
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
384
452
|
if (r2) {
|
|
385
|
-
throw
|
|
453
|
+
throw takeFromExternrefTable0(r1);
|
|
386
454
|
}
|
|
387
|
-
return
|
|
455
|
+
return takeFromExternrefTable0(r0);
|
|
388
456
|
} finally {
|
|
389
457
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
390
458
|
}
|
|
@@ -396,7 +464,7 @@ export class BlazeCache {
|
|
|
396
464
|
*/
|
|
397
465
|
tagsOf(key) {
|
|
398
466
|
try {
|
|
399
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
467
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
400
468
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
401
469
|
const len0 = WASM_VECTOR_LEN;
|
|
402
470
|
wasm.blazecache_tagsOf(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -421,9 +489,10 @@ export class BlazeCache {
|
|
|
421
489
|
* @returns {boolean}
|
|
422
490
|
*/
|
|
423
491
|
touch(key, ttl_ms) {
|
|
492
|
+
const val2 = +(isLikeNone(ttl_ms) ? 0 : ttl_ms);
|
|
424
493
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
425
494
|
const len0 = WASM_VECTOR_LEN;
|
|
426
|
-
const ret = wasm.blazecache_touch(this.__wbg_ptr, ptr0, len0, !isLikeNone(ttl_ms),
|
|
495
|
+
const ret = wasm.blazecache_touch(this.__wbg_ptr, ptr0, len0, !isLikeNone(ttl_ms), val2);
|
|
427
496
|
return ret !== 0;
|
|
428
497
|
}
|
|
429
498
|
/**
|
|
@@ -434,7 +503,7 @@ export class BlazeCache {
|
|
|
434
503
|
*/
|
|
435
504
|
ttl(key) {
|
|
436
505
|
try {
|
|
437
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
506
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
438
507
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
439
508
|
const len0 = WASM_VECTOR_LEN;
|
|
440
509
|
wasm.blazecache_ttl(retptr, this.__wbg_ptr, ptr0, len0);
|
|
@@ -448,6 +517,27 @@ export class BlazeCache {
|
|
|
448
517
|
}
|
|
449
518
|
if (Symbol.dispose) BlazeCache.prototype[Symbol.dispose] = BlazeCache.prototype.free;
|
|
450
519
|
|
|
520
|
+
/**
|
|
521
|
+
* Ensures the shared key scratch holds at least `len` bytes and returns its offset in
|
|
522
|
+
* wasm memory.
|
|
523
|
+
*
|
|
524
|
+
* The host encodes keys here — once per *distinct* key; a repeated key is served from the
|
|
525
|
+
* wrapper's last-key cache with no write at all — and hands the offset to
|
|
526
|
+
* [`getRaw`](BlazeCache::get_raw)/[`setRaw`](BlazeCache::set_raw)/
|
|
527
|
+
* [`deleteRaw`](BlazeCache::delete_raw). That is what keeps a read from paying
|
|
528
|
+
* `passStringToWasm0`'s malloc + copy + free on every single call.
|
|
529
|
+
*
|
|
530
|
+
* The returned offset stays valid until the next `ensureScratch` that has to grow the
|
|
531
|
+
* buffer; `memory.grow` never moves it (wasm memory contents are preserved across
|
|
532
|
+
* growth), so the wrapper only has to refresh its `Uint8Array` view, not the pointer.
|
|
533
|
+
* @param {number} len
|
|
534
|
+
* @returns {number}
|
|
535
|
+
*/
|
|
536
|
+
export function ensureScratch(len) {
|
|
537
|
+
const ret = wasm.ensureScratch(len);
|
|
538
|
+
return ret >>> 0;
|
|
539
|
+
}
|
|
540
|
+
|
|
451
541
|
/**
|
|
452
542
|
* Installs a panic hook that forwards Rust panics to `console.error`, making debugging in
|
|
453
543
|
* devtools far less painful. Safe to call more than once.
|
|
@@ -458,30 +548,30 @@ export function setPanicHook() {
|
|
|
458
548
|
function __wbg_get_imports() {
|
|
459
549
|
const import0 = {
|
|
460
550
|
__proto__: null,
|
|
461
|
-
|
|
551
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
462
552
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
463
|
-
return
|
|
553
|
+
return ret;
|
|
464
554
|
},
|
|
465
555
|
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
466
|
-
const ret = String(
|
|
556
|
+
const ret = String(arg1);
|
|
467
557
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
468
558
|
const len1 = WASM_VECTOR_LEN;
|
|
469
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
470
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
559
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
560
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
471
561
|
},
|
|
472
|
-
|
|
473
|
-
const ret =
|
|
562
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
563
|
+
const ret = arg0 === undefined;
|
|
474
564
|
return ret;
|
|
475
565
|
},
|
|
476
|
-
|
|
477
|
-
const obj =
|
|
566
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
567
|
+
const obj = arg1;
|
|
478
568
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
479
569
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
480
570
|
var len1 = WASM_VECTOR_LEN;
|
|
481
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
482
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
571
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
572
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
483
573
|
},
|
|
484
|
-
|
|
574
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
485
575
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
486
576
|
},
|
|
487
577
|
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
@@ -495,93 +585,94 @@ function __wbg_get_imports() {
|
|
|
495
585
|
wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
|
|
496
586
|
}
|
|
497
587
|
},
|
|
498
|
-
|
|
499
|
-
const ret = Array.from(
|
|
500
|
-
return
|
|
588
|
+
__wbg_from_eac91875c8a5ffa4: function(arg0) {
|
|
589
|
+
const ret = Array.from(arg0);
|
|
590
|
+
return ret;
|
|
591
|
+
},
|
|
592
|
+
__wbg_get_d7176cfb76d71114: function(arg0, arg1) {
|
|
593
|
+
const ret = arg0[arg1 >>> 0];
|
|
594
|
+
return ret;
|
|
501
595
|
},
|
|
502
|
-
|
|
503
|
-
const ret =
|
|
504
|
-
return
|
|
596
|
+
__wbg_length_b03a0fabb109b1e9: function(arg0) {
|
|
597
|
+
const ret = arg0.length;
|
|
598
|
+
return ret;
|
|
505
599
|
},
|
|
506
|
-
|
|
507
|
-
const ret =
|
|
600
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
601
|
+
const ret = new Array();
|
|
508
602
|
return ret;
|
|
509
603
|
},
|
|
510
|
-
|
|
604
|
+
__wbg_new_bb74001155cb8ca8: function() {
|
|
511
605
|
const ret = new Error();
|
|
512
|
-
return
|
|
606
|
+
return ret;
|
|
513
607
|
},
|
|
514
|
-
|
|
608
|
+
__wbg_new_cd4348290afae586: function() {
|
|
515
609
|
const ret = new Object();
|
|
516
|
-
return
|
|
517
|
-
},
|
|
518
|
-
__wbg_new_ee2291f50781bf1d: function() {
|
|
519
|
-
const ret = new Array();
|
|
520
|
-
return addHeapObject(ret);
|
|
610
|
+
return ret;
|
|
521
611
|
},
|
|
522
612
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
523
|
-
const ret =
|
|
613
|
+
const ret = arg0.now();
|
|
524
614
|
return ret;
|
|
525
615
|
},
|
|
526
|
-
|
|
527
|
-
const ret =
|
|
528
|
-
return
|
|
616
|
+
__wbg_performance_7e4e4494fdc9d07a: function(arg0) {
|
|
617
|
+
const ret = arg0.performance;
|
|
618
|
+
return ret;
|
|
529
619
|
},
|
|
530
|
-
|
|
531
|
-
const ret =
|
|
620
|
+
__wbg_push_c9f4893fc209f768: function(arg0, arg1) {
|
|
621
|
+
const ret = arg0.push(arg1);
|
|
532
622
|
return ret;
|
|
533
623
|
},
|
|
534
|
-
|
|
535
|
-
const ret = Reflect.set(
|
|
624
|
+
__wbg_set_2793479888329cb6: function() { return handleError(function (arg0, arg1, arg2) {
|
|
625
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
536
626
|
return ret;
|
|
537
627
|
}, arguments); },
|
|
538
|
-
|
|
539
|
-
|
|
628
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
629
|
+
arg0[arg1] = arg2;
|
|
540
630
|
},
|
|
541
|
-
|
|
542
|
-
const ret =
|
|
631
|
+
__wbg_stack_575c4e0918581b9c: function(arg0, arg1) {
|
|
632
|
+
const ret = arg1.stack;
|
|
543
633
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
544
634
|
const len1 = WASM_VECTOR_LEN;
|
|
545
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
546
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
635
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
636
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
547
637
|
},
|
|
548
|
-
|
|
549
|
-
const ret = typeof
|
|
550
|
-
return isLikeNone(ret) ? 0 :
|
|
638
|
+
__wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
|
|
639
|
+
const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
|
|
640
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
551
641
|
},
|
|
552
|
-
|
|
553
|
-
const ret = typeof
|
|
554
|
-
return isLikeNone(ret) ? 0 :
|
|
642
|
+
__wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
|
|
643
|
+
const ret = typeof global === 'undefined' ? undefined : global;
|
|
644
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
555
645
|
},
|
|
556
|
-
|
|
557
|
-
const ret = typeof self === 'undefined' ?
|
|
558
|
-
return isLikeNone(ret) ? 0 :
|
|
646
|
+
__wbg_static_accessor_SELF_53bb20457401453d: function() {
|
|
647
|
+
const ret = typeof self === 'undefined' ? undefined : self;
|
|
648
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
559
649
|
},
|
|
560
|
-
|
|
561
|
-
const ret = typeof window === 'undefined' ?
|
|
562
|
-
return isLikeNone(ret) ? 0 :
|
|
650
|
+
__wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
|
|
651
|
+
const ret = typeof window === 'undefined' ? undefined : window;
|
|
652
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
563
653
|
},
|
|
564
654
|
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
565
655
|
// Cast intrinsic for `F64 -> Externref`.
|
|
566
656
|
const ret = arg0;
|
|
567
|
-
return
|
|
657
|
+
return ret;
|
|
568
658
|
},
|
|
569
659
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
570
660
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
571
661
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
572
|
-
return
|
|
662
|
+
return ret;
|
|
573
663
|
},
|
|
574
664
|
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
575
665
|
// Cast intrinsic for `U64 -> Externref`.
|
|
576
666
|
const ret = BigInt.asUintN(64, arg0);
|
|
577
|
-
return
|
|
578
|
-
},
|
|
579
|
-
__wbindgen_object_clone_ref: function(arg0) {
|
|
580
|
-
const ret = getObject(arg0);
|
|
581
|
-
return addHeapObject(ret);
|
|
667
|
+
return ret;
|
|
582
668
|
},
|
|
583
|
-
|
|
584
|
-
|
|
669
|
+
__wbindgen_init_externref_table: function() {
|
|
670
|
+
const table = wasm.__wbindgen_externrefs;
|
|
671
|
+
table.set(0, undefined);
|
|
672
|
+
table.set(1024, undefined);
|
|
673
|
+
table.set(1025, null);
|
|
674
|
+
table.set(1026, true);
|
|
675
|
+
table.set(1027, false);
|
|
585
676
|
},
|
|
586
677
|
};
|
|
587
678
|
return {
|
|
@@ -594,28 +685,20 @@ const BlazeCacheFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
594
685
|
? { register: () => {}, unregister: () => {} }
|
|
595
686
|
: new FinalizationRegistry(ptr => wasm.__wbg_blazecache_free(ptr, 1));
|
|
596
687
|
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
heap_next = heap[idx];
|
|
601
|
-
|
|
602
|
-
heap[idx] = obj;
|
|
688
|
+
function addToExternrefTable0(obj) {
|
|
689
|
+
const idx = wasm.__wbindgen_export5();
|
|
690
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
603
691
|
return idx;
|
|
604
692
|
}
|
|
605
693
|
|
|
606
|
-
function dropObject(idx) {
|
|
607
|
-
if (idx < 1028) return;
|
|
608
|
-
heap[idx] = heap_next;
|
|
609
|
-
heap_next = idx;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
694
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
613
695
|
ptr = ptr >>> 0;
|
|
614
696
|
const mem = getDataViewMemory0();
|
|
615
697
|
const result = [];
|
|
616
698
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
617
|
-
result.push(
|
|
699
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
618
700
|
}
|
|
701
|
+
wasm.__wbindgen_export6(ptr, len);
|
|
619
702
|
return result;
|
|
620
703
|
}
|
|
621
704
|
|
|
@@ -641,7 +724,8 @@ function getFloat64ArrayMemory0() {
|
|
|
641
724
|
}
|
|
642
725
|
|
|
643
726
|
function getStringFromWasm0(ptr, len) {
|
|
644
|
-
|
|
727
|
+
ptr = ptr >>> 0;
|
|
728
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
645
729
|
}
|
|
646
730
|
|
|
647
731
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -660,21 +744,15 @@ function getUint8ArrayMemory0() {
|
|
|
660
744
|
return cachedUint8ArrayMemory0;
|
|
661
745
|
}
|
|
662
746
|
|
|
663
|
-
function getObject(idx) { return heap[idx]; }
|
|
664
|
-
|
|
665
747
|
function handleError(f, args) {
|
|
666
748
|
try {
|
|
667
749
|
return f.apply(this, args);
|
|
668
750
|
} catch (e) {
|
|
669
|
-
|
|
751
|
+
const idx = addToExternrefTable0(e);
|
|
752
|
+
wasm.__wbindgen_export4(idx);
|
|
670
753
|
}
|
|
671
754
|
}
|
|
672
755
|
|
|
673
|
-
let heap = new Array(1024).fill(undefined);
|
|
674
|
-
heap.push(undefined, null, true, false);
|
|
675
|
-
|
|
676
|
-
let heap_next = heap.length;
|
|
677
|
-
|
|
678
756
|
function isLikeNone(x) {
|
|
679
757
|
return x === undefined || x === null;
|
|
680
758
|
}
|
|
@@ -695,9 +773,9 @@ function passArrayF64ToWasm0(arg, malloc) {
|
|
|
695
773
|
|
|
696
774
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
697
775
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
698
|
-
const mem = getDataViewMemory0();
|
|
699
776
|
for (let i = 0; i < array.length; i++) {
|
|
700
|
-
|
|
777
|
+
const add = addToExternrefTable0(array[i]);
|
|
778
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
701
779
|
}
|
|
702
780
|
WASM_VECTOR_LEN = array.length;
|
|
703
781
|
return ptr;
|
|
@@ -740,24 +818,24 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
740
818
|
return ptr;
|
|
741
819
|
}
|
|
742
820
|
|
|
743
|
-
function
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
return
|
|
821
|
+
function takeFromExternrefTable0(idx) {
|
|
822
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
823
|
+
wasm.__wbindgen_export7(idx);
|
|
824
|
+
return value;
|
|
747
825
|
}
|
|
748
826
|
|
|
749
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
827
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
750
828
|
cachedTextDecoder.decode();
|
|
751
829
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
752
830
|
let numBytesDecoded = 0;
|
|
753
|
-
function decodeText(
|
|
754
|
-
numBytesDecoded +=
|
|
831
|
+
function decodeText(bytes) {
|
|
832
|
+
numBytesDecoded += bytes.length;
|
|
755
833
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
756
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
834
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
757
835
|
cachedTextDecoder.decode();
|
|
758
|
-
numBytesDecoded =
|
|
836
|
+
numBytesDecoded = bytes.length;
|
|
759
837
|
}
|
|
760
|
-
return cachedTextDecoder.decode(
|
|
838
|
+
return cachedTextDecoder.decode(bytes);
|
|
761
839
|
}
|
|
762
840
|
|
|
763
841
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -784,6 +862,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
784
862
|
cachedFloat64ArrayMemory0 = null;
|
|
785
863
|
cachedUint32ArrayMemory0 = null;
|
|
786
864
|
cachedUint8ArrayMemory0 = null;
|
|
865
|
+
wasm.__wbindgen_start();
|
|
787
866
|
return wasm;
|
|
788
867
|
}
|
|
789
868
|
|
|
@@ -846,9 +925,17 @@ function initSync(module) {
|
|
|
846
925
|
return __wbg_finalize_init(instance, module);
|
|
847
926
|
}
|
|
848
927
|
|
|
928
|
+
let __wbg_init_promise;
|
|
849
929
|
async function __wbg_init(module_or_path) {
|
|
850
930
|
if (wasm !== undefined) return wasm;
|
|
931
|
+
if (__wbg_init_promise === undefined) {
|
|
932
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
933
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
934
|
+
}
|
|
935
|
+
return __wbg_init_promise;
|
|
936
|
+
}
|
|
851
937
|
|
|
938
|
+
async function __wbg_init_once(module_or_path) {
|
|
852
939
|
|
|
853
940
|
if (module_or_path !== undefined) {
|
|
854
941
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
Binary file
|