@iyulab/u-numflow 0.8.0 → 0.10.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 +87 -11
- package/node/u_numflow.cjs +405 -1
- package/node/u_numflow.d.cts +103 -0
- package/node/u_numflow_bg.wasm +0 -0
- package/package.json +1 -1
- package/u_numflow.d.ts +103 -0
- package/u_numflow.js +1 -1
- package/u_numflow_bg.js +396 -1
- package/u_numflow_bg.wasm +0 -0
package/u_numflow_bg.js
CHANGED
|
@@ -56,6 +56,87 @@ export function chi_squared_quantile(p, k) {
|
|
|
56
56
|
return ret[0];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* `P(X ≤ x)` for the distribution `{ kind, ...parameters }`.
|
|
61
|
+
*
|
|
62
|
+
* # Errors
|
|
63
|
+
* As every `distribution` argument: `malformed_input` for a value that is
|
|
64
|
+
* not such an object, `unknown_option` for an unknown `kind` (with
|
|
65
|
+
* `expected`), `value_not_finite` for a NaN or infinite parameter,
|
|
66
|
+
* `parameter_out_of_range` for a parameter that must be `> 0`, and
|
|
67
|
+
* `invalid_option` for parameters out of order (`min < max`,
|
|
68
|
+
* `min ≤ mode ≤ max`). `x` NaN throws `value_not_finite`.
|
|
69
|
+
* @param {DistributionSpec} distribution
|
|
70
|
+
* @param {number} x
|
|
71
|
+
* @returns {number}
|
|
72
|
+
*/
|
|
73
|
+
export function distribution_cdf(distribution, x) {
|
|
74
|
+
const ret = wasm.distribution_cdf(distribution, x);
|
|
75
|
+
if (ret[2]) {
|
|
76
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
77
|
+
}
|
|
78
|
+
return ret[0];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Mean and variance of `distribution` — also the way to check a
|
|
83
|
+
* specification before using it.
|
|
84
|
+
*
|
|
85
|
+
* # Errors
|
|
86
|
+
* As [`distribution_cdf`] for `distribution`.
|
|
87
|
+
* @param {DistributionSpec} distribution
|
|
88
|
+
* @returns {MomentsDto}
|
|
89
|
+
*/
|
|
90
|
+
export function distribution_moments(distribution) {
|
|
91
|
+
const ret = wasm.distribution_moments(distribution);
|
|
92
|
+
if (ret[2]) {
|
|
93
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
94
|
+
}
|
|
95
|
+
return takeFromExternrefTable0(ret[0]);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The `x` with `P(X ≤ x) = p`.
|
|
100
|
+
*
|
|
101
|
+
* # Errors
|
|
102
|
+
* As [`distribution_cdf`] for `distribution`; `p` outside `(0, 1)` throws
|
|
103
|
+
* `parameter_out_of_range`.
|
|
104
|
+
* @param {DistributionSpec} distribution
|
|
105
|
+
* @param {number} p
|
|
106
|
+
* @returns {number}
|
|
107
|
+
*/
|
|
108
|
+
export function distribution_quantile(distribution, p) {
|
|
109
|
+
const ret = wasm.distribution_quantile(distribution, p);
|
|
110
|
+
if (ret[2]) {
|
|
111
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
112
|
+
}
|
|
113
|
+
return ret[0];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* `n` random variates, reproducible from `seed`: the same `(distribution, n,
|
|
118
|
+
* seed)` always returns the same values. Uniforms are drawn from the open
|
|
119
|
+
* interval (0, 1), so no variate is infinite.
|
|
120
|
+
*
|
|
121
|
+
* # Errors
|
|
122
|
+
* As [`distribution_cdf`] for `distribution`; `n` not a whole number in
|
|
123
|
+
* `[0, 2³² − 1]` or `seed` not a whole number in `[0, 2⁵³]` throws
|
|
124
|
+
* `parameter_out_of_range`.
|
|
125
|
+
* @param {DistributionSpec} distribution
|
|
126
|
+
* @param {number} n
|
|
127
|
+
* @param {number} seed
|
|
128
|
+
* @returns {Float64Array}
|
|
129
|
+
*/
|
|
130
|
+
export function distribution_sample(distribution, n, seed) {
|
|
131
|
+
const ret = wasm.distribution_sample(distribution, n, seed);
|
|
132
|
+
if (ret[3]) {
|
|
133
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
134
|
+
}
|
|
135
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
136
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
137
|
+
return v1;
|
|
138
|
+
}
|
|
139
|
+
|
|
59
140
|
/**
|
|
60
141
|
* Estimate the optimal Box-Cox lambda via profile maximum likelihood.
|
|
61
142
|
*
|
|
@@ -118,6 +199,96 @@ export function f_distribution_quantile(p, df1, df2) {
|
|
|
118
199
|
return ret[0];
|
|
119
200
|
}
|
|
120
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Points in `a` but not in `b`, in normal form — e.g. a reporting window
|
|
204
|
+
* minus down-time is up-time.
|
|
205
|
+
*
|
|
206
|
+
* # Errors
|
|
207
|
+
* As [`interval_normalize`], naming `a` or `b`.
|
|
208
|
+
* @param {[number, number][]} a
|
|
209
|
+
* @param {[number, number][]} b
|
|
210
|
+
* @returns {[number, number][]}
|
|
211
|
+
*/
|
|
212
|
+
export function interval_difference(a, b) {
|
|
213
|
+
const ret = wasm.interval_difference(a, b);
|
|
214
|
+
if (ret[2]) {
|
|
215
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
216
|
+
}
|
|
217
|
+
return takeFromExternrefTable0(ret[0]);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Points in both `a` and `b`, in normal form. Clipping to a window is
|
|
222
|
+
* `interval_intersection(a, [[from, to]])`.
|
|
223
|
+
*
|
|
224
|
+
* # Errors
|
|
225
|
+
* As [`interval_normalize`], naming `a` or `b`.
|
|
226
|
+
* @param {[number, number][]} a
|
|
227
|
+
* @param {[number, number][]} b
|
|
228
|
+
* @returns {[number, number][]}
|
|
229
|
+
*/
|
|
230
|
+
export function interval_intersection(a, b) {
|
|
231
|
+
const ret = wasm.interval_intersection(a, b);
|
|
232
|
+
if (ret[2]) {
|
|
233
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
234
|
+
}
|
|
235
|
+
return takeFromExternrefTable0(ret[0]);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Total length of the union of `intervals`: each point counts once, however
|
|
240
|
+
* many rows cover it.
|
|
241
|
+
*
|
|
242
|
+
* # Errors
|
|
243
|
+
* As [`interval_normalize`].
|
|
244
|
+
* @param {[number, number][]} intervals
|
|
245
|
+
* @returns {number}
|
|
246
|
+
*/
|
|
247
|
+
export function interval_measure(intervals) {
|
|
248
|
+
const ret = wasm.interval_measure(intervals);
|
|
249
|
+
if (ret[2]) {
|
|
250
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
251
|
+
}
|
|
252
|
+
return ret[0];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The union of `intervals` (each `[start, end]`, half-open) in normal form:
|
|
257
|
+
* sorted, disjoint, touching pieces merged, empty ones dropped.
|
|
258
|
+
*
|
|
259
|
+
* # Errors
|
|
260
|
+
* Throws `malformed_input` for a row that is not two numbers (`parameter` is
|
|
261
|
+
* the row's path, e.g. `intervals[2]`), `value_not_finite` for a NaN or
|
|
262
|
+
* ±Infinity bound, and `reversed_interval` (`parameter`, `index`) for a row
|
|
263
|
+
* with start > end — reversed rows are refused, not swapped.
|
|
264
|
+
* @param {[number, number][]} intervals
|
|
265
|
+
* @returns {[number, number][]}
|
|
266
|
+
*/
|
|
267
|
+
export function interval_normalize(intervals) {
|
|
268
|
+
const ret = wasm.interval_normalize(intervals);
|
|
269
|
+
if (ret[2]) {
|
|
270
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
271
|
+
}
|
|
272
|
+
return takeFromExternrefTable0(ret[0]);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Points in `a` or `b`, in normal form.
|
|
277
|
+
*
|
|
278
|
+
* # Errors
|
|
279
|
+
* As [`interval_normalize`], naming `a` or `b`.
|
|
280
|
+
* @param {[number, number][]} a
|
|
281
|
+
* @param {[number, number][]} b
|
|
282
|
+
* @returns {[number, number][]}
|
|
283
|
+
*/
|
|
284
|
+
export function interval_union(a, b) {
|
|
285
|
+
const ret = wasm.interval_union(a, b);
|
|
286
|
+
if (ret[2]) {
|
|
287
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
288
|
+
}
|
|
289
|
+
return takeFromExternrefTable0(ret[0]);
|
|
290
|
+
}
|
|
291
|
+
|
|
121
292
|
/**
|
|
122
293
|
* Standard normal quantile Φ⁻¹(p): the `z` with `P(Z ≤ z) = p`.
|
|
123
294
|
*
|
|
@@ -270,6 +441,10 @@ export function variance(data) {
|
|
|
270
441
|
}
|
|
271
442
|
return ret[0];
|
|
272
443
|
}
|
|
444
|
+
export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
|
|
445
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
446
|
+
return ret;
|
|
447
|
+
}
|
|
273
448
|
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
274
449
|
const ret = String(arg1);
|
|
275
450
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -277,10 +452,53 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
277
452
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
278
453
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
279
454
|
}
|
|
455
|
+
export function __wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c(arg0, arg1) {
|
|
456
|
+
const v = arg1;
|
|
457
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
458
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
459
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
460
|
+
}
|
|
461
|
+
export function __wbg___wbindgen_boolean_get_5b446f51afd21013(arg0) {
|
|
462
|
+
const v = arg0;
|
|
463
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
464
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
465
|
+
}
|
|
466
|
+
export function __wbg___wbindgen_debug_string_4687d8d8c2017d52(arg0, arg1) {
|
|
467
|
+
const ret = debugString(arg1);
|
|
468
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
|
+
const len1 = WASM_VECTOR_LEN;
|
|
470
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
471
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
472
|
+
}
|
|
473
|
+
export function __wbg___wbindgen_in_92f62ee1427d9e49(arg0, arg1) {
|
|
474
|
+
const ret = arg0 in arg1;
|
|
475
|
+
return ret;
|
|
476
|
+
}
|
|
477
|
+
export function __wbg___wbindgen_is_bigint_b123553bed3bb382(arg0) {
|
|
478
|
+
const ret = typeof(arg0) === 'bigint';
|
|
479
|
+
return ret;
|
|
480
|
+
}
|
|
481
|
+
export function __wbg___wbindgen_is_function_1f9d30630b8b1d3d(arg0) {
|
|
482
|
+
const ret = typeof(arg0) === 'function';
|
|
483
|
+
return ret;
|
|
484
|
+
}
|
|
280
485
|
export function __wbg___wbindgen_is_null_e343b7d08827ba72(arg0) {
|
|
281
486
|
const ret = arg0 === null;
|
|
282
487
|
return ret;
|
|
283
488
|
}
|
|
489
|
+
export function __wbg___wbindgen_is_object_3c45d4f2dde4e749(arg0) {
|
|
490
|
+
const val = arg0;
|
|
491
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
492
|
+
return ret;
|
|
493
|
+
}
|
|
494
|
+
export function __wbg___wbindgen_jsval_eq_02babf21faa37971(arg0, arg1) {
|
|
495
|
+
const ret = arg0 === arg1;
|
|
496
|
+
return ret;
|
|
497
|
+
}
|
|
498
|
+
export function __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461(arg0, arg1) {
|
|
499
|
+
const ret = arg0 == arg1;
|
|
500
|
+
return ret;
|
|
501
|
+
}
|
|
284
502
|
export function __wbg___wbindgen_number_get_2e0e7dee9f701a71(arg0, arg1) {
|
|
285
503
|
const obj = arg1;
|
|
286
504
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -302,10 +520,44 @@ export function __wbg___wbindgen_typeof_e777a26e115d416b(arg0) {
|
|
|
302
520
|
const ret = typeof arg0;
|
|
303
521
|
return ret;
|
|
304
522
|
}
|
|
523
|
+
export function __wbg_call_6137034ef55c9d0f() { return handleError(function (arg0, arg1) {
|
|
524
|
+
const ret = arg0.call(arg1);
|
|
525
|
+
return ret;
|
|
526
|
+
}, arguments); }
|
|
527
|
+
export function __wbg_done_b41a1d26cdb37fb6(arg0) {
|
|
528
|
+
const ret = arg0.done;
|
|
529
|
+
return ret;
|
|
530
|
+
}
|
|
531
|
+
export function __wbg_entries_fb6397112b1de25f(arg0) {
|
|
532
|
+
const ret = Object.entries(arg0);
|
|
533
|
+
return ret;
|
|
534
|
+
}
|
|
535
|
+
export function __wbg_get_31af05bd4842a84f() { return handleError(function (arg0, arg1) {
|
|
536
|
+
const ret = Reflect.get(arg0, arg1);
|
|
537
|
+
return ret;
|
|
538
|
+
}, arguments); }
|
|
539
|
+
export function __wbg_get_658f6698067d9515() { return handleError(function (arg0, arg1) {
|
|
540
|
+
const ret = Reflect.get(arg0, arg1);
|
|
541
|
+
return ret;
|
|
542
|
+
}, arguments); }
|
|
543
|
+
export function __wbg_get_6c896e0571ddae51(arg0, arg1) {
|
|
544
|
+
const ret = arg0[arg1 >>> 0];
|
|
545
|
+
return ret;
|
|
546
|
+
}
|
|
305
547
|
export function __wbg_get_unchecked_288889d017702237(arg0, arg1) {
|
|
306
548
|
const ret = arg0[arg1 >>> 0];
|
|
307
549
|
return ret;
|
|
308
550
|
}
|
|
551
|
+
export function __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8(arg0) {
|
|
552
|
+
let result;
|
|
553
|
+
try {
|
|
554
|
+
result = arg0 instanceof ArrayBuffer;
|
|
555
|
+
} catch (_) {
|
|
556
|
+
result = false;
|
|
557
|
+
}
|
|
558
|
+
const ret = result;
|
|
559
|
+
return ret;
|
|
560
|
+
}
|
|
309
561
|
export function __wbg_instanceof_Float64Array_8a59377f9eec1b8b(arg0) {
|
|
310
562
|
let result;
|
|
311
563
|
try {
|
|
@@ -316,10 +568,42 @@ export function __wbg_instanceof_Float64Array_8a59377f9eec1b8b(arg0) {
|
|
|
316
568
|
const ret = result;
|
|
317
569
|
return ret;
|
|
318
570
|
}
|
|
571
|
+
export function __wbg_instanceof_Map_b2611749102d7ba3(arg0) {
|
|
572
|
+
let result;
|
|
573
|
+
try {
|
|
574
|
+
result = arg0 instanceof Map;
|
|
575
|
+
} catch (_) {
|
|
576
|
+
result = false;
|
|
577
|
+
}
|
|
578
|
+
const ret = result;
|
|
579
|
+
return ret;
|
|
580
|
+
}
|
|
581
|
+
export function __wbg_instanceof_Uint8Array_828cef2aaacafc31(arg0) {
|
|
582
|
+
let result;
|
|
583
|
+
try {
|
|
584
|
+
result = arg0 instanceof Uint8Array;
|
|
585
|
+
} catch (_) {
|
|
586
|
+
result = false;
|
|
587
|
+
}
|
|
588
|
+
const ret = result;
|
|
589
|
+
return ret;
|
|
590
|
+
}
|
|
319
591
|
export function __wbg_isArray_e15a2ff68ffdbef2(arg0) {
|
|
320
592
|
const ret = Array.isArray(arg0);
|
|
321
593
|
return ret;
|
|
322
594
|
}
|
|
595
|
+
export function __wbg_isSafeInteger_717808ad6a54bd9e(arg0) {
|
|
596
|
+
const ret = Number.isSafeInteger(arg0);
|
|
597
|
+
return ret;
|
|
598
|
+
}
|
|
599
|
+
export function __wbg_iterator_e3c31c892080e444() {
|
|
600
|
+
const ret = Symbol.iterator;
|
|
601
|
+
return ret;
|
|
602
|
+
}
|
|
603
|
+
export function __wbg_length_7f3c00c40364105e(arg0) {
|
|
604
|
+
const ret = arg0.length;
|
|
605
|
+
return ret;
|
|
606
|
+
}
|
|
323
607
|
export function __wbg_length_b5f0008bbf60cf59(arg0) {
|
|
324
608
|
const ret = arg0.length;
|
|
325
609
|
return ret;
|
|
@@ -328,6 +612,10 @@ export function __wbg_length_d4bdea10311bd9cf(arg0) {
|
|
|
328
612
|
const ret = arg0.length;
|
|
329
613
|
return ret;
|
|
330
614
|
}
|
|
615
|
+
export function __wbg_new_1dbf7428bba60a42(arg0) {
|
|
616
|
+
const ret = new Uint8Array(arg0);
|
|
617
|
+
return ret;
|
|
618
|
+
}
|
|
331
619
|
export function __wbg_new_343a093a3c2ffb4e(arg0, arg1) {
|
|
332
620
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
333
621
|
return ret;
|
|
@@ -336,9 +624,32 @@ export function __wbg_new_617a8cdb8bb1130e() {
|
|
|
336
624
|
const ret = new Object();
|
|
337
625
|
return ret;
|
|
338
626
|
}
|
|
627
|
+
export function __wbg_new_ee2291f50781bf1d() {
|
|
628
|
+
const ret = new Array();
|
|
629
|
+
return ret;
|
|
630
|
+
}
|
|
631
|
+
export function __wbg_next_33784799010f1bbe(arg0) {
|
|
632
|
+
const ret = arg0.next;
|
|
633
|
+
return ret;
|
|
634
|
+
}
|
|
635
|
+
export function __wbg_next_f4aac29c42af995c() { return handleError(function (arg0) {
|
|
636
|
+
const ret = arg0.next();
|
|
637
|
+
return ret;
|
|
638
|
+
}, arguments); }
|
|
639
|
+
export function __wbg_of_20798cb14708764f(arg0, arg1) {
|
|
640
|
+
const ret = Array.of(arg0, arg1);
|
|
641
|
+
return ret;
|
|
642
|
+
}
|
|
643
|
+
export function __wbg_prototypesetcall_bc27214492979395(arg0, arg1, arg2) {
|
|
644
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
645
|
+
}
|
|
339
646
|
export function __wbg_prototypesetcall_d49a4fab5ca427bc(arg0, arg1, arg2) {
|
|
340
647
|
Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
|
|
341
648
|
}
|
|
649
|
+
export function __wbg_push_2baf45db356cf468(arg0, arg1) {
|
|
650
|
+
const ret = arg0.push(arg1);
|
|
651
|
+
return ret;
|
|
652
|
+
}
|
|
342
653
|
export function __wbg_set_145a351398b48c65() { return handleError(function (arg0, arg1, arg2) {
|
|
343
654
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
344
655
|
return ret;
|
|
@@ -346,16 +657,30 @@ export function __wbg_set_145a351398b48c65() { return handleError(function (arg0
|
|
|
346
657
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
347
658
|
arg0[arg1] = arg2;
|
|
348
659
|
}
|
|
660
|
+
export function __wbg_value_f3c585ee8f5ba40c(arg0) {
|
|
661
|
+
const ret = arg0.value;
|
|
662
|
+
return ret;
|
|
663
|
+
}
|
|
349
664
|
export function __wbindgen_generic_0000000000000001(arg0) {
|
|
350
665
|
// Cast intrinsic for `F64 -> Externref`.
|
|
351
666
|
const ret = arg0;
|
|
352
667
|
return ret;
|
|
353
668
|
}
|
|
354
|
-
export function __wbindgen_generic_0000000000000002(arg0
|
|
669
|
+
export function __wbindgen_generic_0000000000000002(arg0) {
|
|
670
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
671
|
+
const ret = arg0;
|
|
672
|
+
return ret;
|
|
673
|
+
}
|
|
674
|
+
export function __wbindgen_generic_0000000000000003(arg0, arg1) {
|
|
355
675
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
356
676
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
357
677
|
return ret;
|
|
358
678
|
}
|
|
679
|
+
export function __wbindgen_generic_0000000000000004(arg0) {
|
|
680
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
681
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
682
|
+
return ret;
|
|
683
|
+
}
|
|
359
684
|
export function __wbindgen_init_externref_table() {
|
|
360
685
|
const table = wasm.__wbindgen_externrefs;
|
|
361
686
|
const offset = table.grow(4);
|
|
@@ -371,11 +696,81 @@ function addToExternrefTable0(obj) {
|
|
|
371
696
|
return idx;
|
|
372
697
|
}
|
|
373
698
|
|
|
699
|
+
function debugString(val) {
|
|
700
|
+
// primitive types
|
|
701
|
+
const type = typeof val;
|
|
702
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
703
|
+
return `${val}`;
|
|
704
|
+
}
|
|
705
|
+
if (type == 'string') {
|
|
706
|
+
return `"${val}"`;
|
|
707
|
+
}
|
|
708
|
+
if (type == 'symbol') {
|
|
709
|
+
const description = val.description;
|
|
710
|
+
if (description == null) {
|
|
711
|
+
return 'Symbol';
|
|
712
|
+
} else {
|
|
713
|
+
return `Symbol(${description})`;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
if (type == 'function') {
|
|
717
|
+
const name = val.name;
|
|
718
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
719
|
+
return `Function(${name})`;
|
|
720
|
+
} else {
|
|
721
|
+
return 'Function';
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
// objects
|
|
725
|
+
if (Array.isArray(val)) {
|
|
726
|
+
const length = val.length;
|
|
727
|
+
let debug = '[';
|
|
728
|
+
if (length > 0) {
|
|
729
|
+
debug += debugString(val[0]);
|
|
730
|
+
}
|
|
731
|
+
for(let i = 1; i < length; i++) {
|
|
732
|
+
debug += ', ' + debugString(val[i]);
|
|
733
|
+
}
|
|
734
|
+
debug += ']';
|
|
735
|
+
return debug;
|
|
736
|
+
}
|
|
737
|
+
// Test for built-in
|
|
738
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
739
|
+
let className;
|
|
740
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
741
|
+
className = builtInMatches[1];
|
|
742
|
+
} else {
|
|
743
|
+
// Failed to match the standard '[object ClassName]'
|
|
744
|
+
return toString.call(val);
|
|
745
|
+
}
|
|
746
|
+
if (className == 'Object') {
|
|
747
|
+
// we're a user defined class or Object
|
|
748
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
749
|
+
// easier than looping through ownProperties of `val`.
|
|
750
|
+
try {
|
|
751
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
752
|
+
} catch (_) {
|
|
753
|
+
return 'Object';
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
// errors
|
|
757
|
+
if (val instanceof Error) {
|
|
758
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
759
|
+
}
|
|
760
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
761
|
+
return className;
|
|
762
|
+
}
|
|
763
|
+
|
|
374
764
|
function getArrayF64FromWasm0(ptr, len) {
|
|
375
765
|
ptr = ptr >>> 0;
|
|
376
766
|
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
377
767
|
}
|
|
378
768
|
|
|
769
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
770
|
+
ptr = ptr >>> 0;
|
|
771
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
772
|
+
}
|
|
773
|
+
|
|
379
774
|
let cachedDataViewMemory0 = null;
|
|
380
775
|
function getDataViewMemory0() {
|
|
381
776
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
package/u_numflow_bg.wasm
CHANGED
|
Binary file
|