libchai 0.2.4 → 0.3.0-beta.1

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/chai.d.ts CHANGED
@@ -10,6 +10,7 @@ export function validate(js_config: any): any;
10
10
  export class Web {
11
11
  private constructor();
12
12
  free(): void;
13
+ [Symbol.dispose](): void;
13
14
  static new(回调: Function): Web;
14
15
  sync(前端参数: any): void;
15
16
  encode_evaluate(前端目标函数配置: any): any;
package/chai.js CHANGED
@@ -1,13 +1,5 @@
1
1
  let wasm;
2
2
 
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let WASM_VECTOR_LEN = 0;
10
-
11
3
  let cachedUint8ArrayMemory0 = null;
12
4
 
13
5
  function getUint8ArrayMemory0() {
@@ -17,20 +9,58 @@ function getUint8ArrayMemory0() {
17
9
  return cachedUint8ArrayMemory0;
18
10
  }
19
11
 
20
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
12
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
21
13
 
22
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
23
- ? function (arg, view) {
24
- return cachedTextEncoder.encodeInto(arg, view);
14
+ cachedTextDecoder.decode();
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
33
+ let heap = new Array(128).fill(undefined);
34
+
35
+ heap.push(undefined, null, true, false);
36
+
37
+ let heap_next = heap.length;
38
+
39
+ function addHeapObject(obj) {
40
+ if (heap_next === heap.length) heap.push(heap.length + 1);
41
+ const idx = heap_next;
42
+ heap_next = heap[idx];
43
+
44
+ heap[idx] = obj;
45
+ return idx;
46
+ }
47
+
48
+ function getObject(idx) { return heap[idx]; }
49
+
50
+ let WASM_VECTOR_LEN = 0;
51
+
52
+ const cachedTextEncoder = new TextEncoder();
53
+
54
+ if (!('encodeInto' in cachedTextEncoder)) {
55
+ cachedTextEncoder.encodeInto = function (arg, view) {
56
+ const buf = cachedTextEncoder.encode(arg);
57
+ view.set(buf);
58
+ return {
59
+ read: arg.length,
60
+ written: buf.length
61
+ };
62
+ }
25
63
  }
26
- : function (arg, view) {
27
- const buf = cachedTextEncoder.encode(arg);
28
- view.set(buf);
29
- return {
30
- read: arg.length,
31
- written: buf.length
32
- };
33
- });
34
64
 
35
65
  function passStringToWasm0(arg, malloc, realloc) {
36
66
 
@@ -61,7 +91,7 @@ function passStringToWasm0(arg, malloc, realloc) {
61
91
  }
62
92
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
63
93
  const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
64
- const ret = encodeString(arg, view);
94
+ const ret = cachedTextEncoder.encodeInto(arg, view);
65
95
 
66
96
  offset += ret.written;
67
97
  ptr = realloc(ptr, len, offset, 1) >>> 0;
@@ -80,17 +110,6 @@ function getDataViewMemory0() {
80
110
  return cachedDataViewMemory0;
81
111
  }
82
112
 
83
- let heap_next = heap.length;
84
-
85
- function addHeapObject(obj) {
86
- if (heap_next === heap.length) heap.push(heap.length + 1);
87
- const idx = heap_next;
88
- heap_next = heap[idx];
89
-
90
- heap[idx] = obj;
91
- return idx;
92
- }
93
-
94
113
  function handleError(f, args) {
95
114
  try {
96
115
  return f.apply(this, args);
@@ -99,13 +118,9 @@ function handleError(f, args) {
99
118
  }
100
119
  }
101
120
 
102
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
103
-
104
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
105
-
106
- function getStringFromWasm0(ptr, len) {
121
+ function getArrayU8FromWasm0(ptr, len) {
107
122
  ptr = ptr >>> 0;
108
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
123
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
109
124
  }
110
125
 
111
126
  function dropObject(idx) {
@@ -293,6 +308,9 @@ export class Web {
293
308
  }
294
309
  }
295
310
  }
311
+ if (Symbol.dispose) Web.prototype[Symbol.dispose] = Web.prototype.free;
312
+
313
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
296
314
 
297
315
  async function __wbg_load(module, imports) {
298
316
  if (typeof Response === 'function' && module instanceof Response) {
@@ -301,7 +319,9 @@ async function __wbg_load(module, imports) {
301
319
  return await WebAssembly.instantiateStreaming(module, imports);
302
320
 
303
321
  } catch (e) {
304
- if (module.headers.get('Content-Type') != 'application/wasm') {
322
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
323
+
324
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
305
325
  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);
306
326
 
307
327
  } else {
@@ -328,6 +348,14 @@ async function __wbg_load(module, imports) {
328
348
  function __wbg_get_imports() {
329
349
  const imports = {};
330
350
  imports.wbg = {};
351
+ imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
352
+ const ret = Error(getStringFromWasm0(arg0, arg1));
353
+ return addHeapObject(ret);
354
+ };
355
+ imports.wbg.__wbg_Number_998bea33bd87c3e0 = function(arg0) {
356
+ const ret = Number(getObject(arg0));
357
+ return ret;
358
+ };
331
359
  imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
332
360
  const ret = String(getObject(arg1));
333
361
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -335,31 +363,23 @@ function __wbg_get_imports() {
335
363
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
336
364
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
337
365
  };
338
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
339
- const ret = getObject(arg0).buffer;
340
- return addHeapObject(ret);
341
- };
342
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
366
+ imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
343
367
  const ret = getObject(arg0).call(getObject(arg1));
344
368
  return addHeapObject(ret);
345
369
  }, arguments) };
346
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
370
+ imports.wbg.__wbg_call_a5400b25a865cfd8 = function() { return handleError(function (arg0, arg1, arg2) {
347
371
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
348
372
  return addHeapObject(ret);
349
373
  }, arguments) };
350
- imports.wbg.__wbg_codePointAt_78181f32881e5b59 = function(arg0, arg1) {
374
+ imports.wbg.__wbg_codePointAt_6ee161d941249514 = function(arg0, arg1) {
351
375
  const ret = getObject(arg0).codePointAt(arg1 >>> 0);
352
376
  return addHeapObject(ret);
353
377
  };
354
- imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
355
- const ret = getObject(arg0).crypto;
356
- return addHeapObject(ret);
357
- };
358
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
378
+ imports.wbg.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
359
379
  const ret = getObject(arg0).done;
360
380
  return ret;
361
381
  };
362
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
382
+ imports.wbg.__wbg_entries_2be2f15bd5554996 = function(arg0) {
363
383
  const ret = Object.entries(getObject(arg0));
364
384
  return addHeapObject(ret);
365
385
  };
@@ -374,26 +394,26 @@ function __wbg_get_imports() {
374
394
  wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
375
395
  }
376
396
  };
377
- imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
397
+ imports.wbg.__wbg_fromCodePoint_497220cbed07e190 = function() { return handleError(function (arg0) {
378
398
  const ret = String.fromCodePoint(arg0 >>> 0);
379
399
  return addHeapObject(ret);
380
400
  }, arguments) };
381
- imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
382
- getObject(arg0).getRandomValues(getObject(arg1));
383
- }, arguments) };
384
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
385
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
386
- return addHeapObject(ret);
401
+ imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
402
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
387
403
  }, arguments) };
388
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
404
+ imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
389
405
  const ret = getObject(arg0)[arg1 >>> 0];
390
406
  return addHeapObject(ret);
391
407
  };
408
+ imports.wbg.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
409
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
410
+ return addHeapObject(ret);
411
+ }, arguments) };
392
412
  imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
393
413
  const ret = getObject(arg0)[getObject(arg1)];
394
414
  return addHeapObject(ret);
395
415
  };
396
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
416
+ imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
397
417
  let result;
398
418
  try {
399
419
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -403,7 +423,7 @@ function __wbg_get_imports() {
403
423
  const ret = result;
404
424
  return ret;
405
425
  };
406
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
426
+ imports.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b = function(arg0) {
407
427
  let result;
408
428
  try {
409
429
  result = getObject(arg0) instanceof Map;
@@ -413,7 +433,7 @@ function __wbg_get_imports() {
413
433
  const ret = result;
414
434
  return ret;
415
435
  };
416
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
436
+ imports.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
417
437
  let result;
418
438
  try {
419
439
  result = getObject(arg0) instanceof Uint8Array;
@@ -423,78 +443,62 @@ function __wbg_get_imports() {
423
443
  const ret = result;
424
444
  return ret;
425
445
  };
426
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
446
+ imports.wbg.__wbg_isArray_030cce220591fb41 = function(arg0) {
427
447
  const ret = Array.isArray(getObject(arg0));
428
448
  return ret;
429
449
  };
430
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
450
+ imports.wbg.__wbg_isSafeInteger_1c0d1af5542e102a = function(arg0) {
431
451
  const ret = Number.isSafeInteger(getObject(arg0));
432
452
  return ret;
433
453
  };
434
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
454
+ imports.wbg.__wbg_iterator_f370b34483c71a1c = function() {
435
455
  const ret = Symbol.iterator;
436
456
  return addHeapObject(ret);
437
457
  };
438
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
458
+ imports.wbg.__wbg_length_186546c51cd61acd = function(arg0) {
439
459
  const ret = getObject(arg0).length;
440
460
  return ret;
441
461
  };
442
- imports.wbg.__wbg_length_d56737991078581b = function(arg0) {
462
+ imports.wbg.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
443
463
  const ret = getObject(arg0).length;
444
464
  return ret;
445
465
  };
446
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
466
+ imports.wbg.__wbg_length_9d771c54845e987f = function(arg0) {
447
467
  const ret = getObject(arg0).length;
448
468
  return ret;
449
469
  };
450
- imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
451
- const ret = getObject(arg0).msCrypto;
470
+ imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
471
+ const ret = new Object();
452
472
  return addHeapObject(ret);
453
473
  };
454
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
455
- const ret = new Object();
474
+ imports.wbg.__wbg_new_1f3a344cf3123716 = function() {
475
+ const ret = new Array();
456
476
  return addHeapObject(ret);
457
477
  };
458
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
478
+ imports.wbg.__wbg_new_2ff1f68f3676ea53 = function() {
459
479
  const ret = new Map();
460
480
  return addHeapObject(ret);
461
481
  };
462
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
463
- const ret = new Array();
482
+ imports.wbg.__wbg_new_638ebfaedbf32a5e = function(arg0) {
483
+ const ret = new Uint8Array(getObject(arg0));
464
484
  return addHeapObject(ret);
465
485
  };
466
486
  imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
467
487
  const ret = new Error();
468
488
  return addHeapObject(ret);
469
489
  };
470
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
471
- const ret = new Uint8Array(getObject(arg0));
472
- return addHeapObject(ret);
473
- };
474
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
490
+ imports.wbg.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
475
491
  const ret = new Function(getStringFromWasm0(arg0, arg1));
476
492
  return addHeapObject(ret);
477
493
  };
478
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
479
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
480
- return addHeapObject(ret);
481
- };
482
- imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
483
- const ret = new Uint8Array(arg0 >>> 0);
484
- return addHeapObject(ret);
485
- };
486
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
494
+ imports.wbg.__wbg_next_5b3530e612fde77d = function(arg0) {
487
495
  const ret = getObject(arg0).next;
488
496
  return addHeapObject(ret);
489
497
  };
490
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
498
+ imports.wbg.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
491
499
  const ret = getObject(arg0).next();
492
500
  return addHeapObject(ret);
493
501
  }, arguments) };
494
- imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
495
- const ret = getObject(arg0).node;
496
- return addHeapObject(ret);
497
- };
498
502
  imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
499
503
  const ret = getObject(arg0).now();
500
504
  return ret;
@@ -503,27 +507,16 @@ function __wbg_get_imports() {
503
507
  const ret = getObject(arg0).performance;
504
508
  return addHeapObject(ret);
505
509
  };
506
- imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
507
- const ret = getObject(arg0).process;
508
- return addHeapObject(ret);
509
- };
510
- imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
511
- getObject(arg0).randomFillSync(takeObject(arg1));
512
- }, arguments) };
513
- imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
514
- const ret = module.require;
515
- return addHeapObject(ret);
516
- }, arguments) };
517
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
518
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
510
+ imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
511
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
519
512
  };
520
513
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
521
514
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
522
515
  };
523
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
524
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
516
+ imports.wbg.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
517
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
525
518
  };
526
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
519
+ imports.wbg.__wbg_set_b7f1cf4fae26fe2a = function(arg0, arg1, arg2) {
527
520
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
528
521
  return addHeapObject(ret);
529
522
  };
@@ -534,123 +527,84 @@ function __wbg_get_imports() {
534
527
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
535
528
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
536
529
  };
537
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
530
+ imports.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12 = function() {
538
531
  const ret = typeof global === 'undefined' ? null : global;
539
532
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
540
533
  };
541
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
534
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184 = function() {
542
535
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
543
536
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
544
537
  };
545
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
538
+ imports.wbg.__wbg_static_accessor_SELF_995b214ae681ff99 = function() {
546
539
  const ret = typeof self === 'undefined' ? null : self;
547
540
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
548
541
  };
549
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
542
+ imports.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
550
543
  const ret = typeof window === 'undefined' ? null : window;
551
544
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
552
545
  };
553
- imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
554
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
555
- return addHeapObject(ret);
556
- };
557
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
546
+ imports.wbg.__wbg_value_dd9372230531eade = function(arg0) {
558
547
  const ret = getObject(arg0).value;
559
548
  return addHeapObject(ret);
560
549
  };
561
- imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
562
- const ret = getObject(arg0).versions;
563
- return addHeapObject(ret);
564
- };
565
- imports.wbg.__wbindgen_as_number = function(arg0) {
566
- const ret = +getObject(arg0);
567
- return ret;
568
- };
569
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
570
- const ret = arg0;
571
- return addHeapObject(ret);
572
- };
573
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
574
- const ret = BigInt.asUintN(64, arg0);
575
- return addHeapObject(ret);
576
- };
577
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
550
+ imports.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
578
551
  const v = getObject(arg1);
579
552
  const ret = typeof(v) === 'bigint' ? v : undefined;
580
553
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
581
554
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
582
555
  };
583
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
556
+ imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
584
557
  const v = getObject(arg0);
585
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
586
- return ret;
558
+ const ret = typeof(v) === 'boolean' ? v : undefined;
559
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
587
560
  };
588
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
561
+ imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
589
562
  const ret = debugString(getObject(arg1));
590
563
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
591
564
  const len1 = WASM_VECTOR_LEN;
592
565
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
593
566
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
594
567
  };
595
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
596
- const ret = new Error(getStringFromWasm0(arg0, arg1));
597
- return addHeapObject(ret);
598
- };
599
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
568
+ imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
600
569
  const ret = getObject(arg0) in getObject(arg1);
601
570
  return ret;
602
571
  };
603
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
572
+ imports.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154 = function(arg0) {
604
573
  const ret = typeof(getObject(arg0)) === 'bigint';
605
574
  return ret;
606
575
  };
607
- imports.wbg.__wbindgen_is_function = function(arg0) {
576
+ imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
608
577
  const ret = typeof(getObject(arg0)) === 'function';
609
578
  return ret;
610
579
  };
611
- imports.wbg.__wbindgen_is_object = function(arg0) {
580
+ imports.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
612
581
  const val = getObject(arg0);
613
582
  const ret = typeof(val) === 'object' && val !== null;
614
583
  return ret;
615
584
  };
616
- imports.wbg.__wbindgen_is_string = function(arg0) {
585
+ imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
617
586
  const ret = typeof(getObject(arg0)) === 'string';
618
587
  return ret;
619
588
  };
620
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
589
+ imports.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
621
590
  const ret = getObject(arg0) === undefined;
622
591
  return ret;
623
592
  };
624
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
593
+ imports.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
625
594
  const ret = getObject(arg0) === getObject(arg1);
626
595
  return ret;
627
596
  };
628
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
597
+ imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
629
598
  const ret = getObject(arg0) == getObject(arg1);
630
599
  return ret;
631
600
  };
632
- imports.wbg.__wbindgen_memory = function() {
633
- const ret = wasm.memory;
634
- return addHeapObject(ret);
635
- };
636
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
601
+ imports.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
637
602
  const obj = getObject(arg1);
638
603
  const ret = typeof(obj) === 'number' ? obj : undefined;
639
604
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
640
605
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
641
606
  };
642
- imports.wbg.__wbindgen_number_new = function(arg0) {
643
- const ret = arg0;
644
- return addHeapObject(ret);
645
- };
646
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
647
- const ret = getObject(arg0);
648
- return addHeapObject(ret);
649
- };
650
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
651
- takeObject(arg0);
652
- };
653
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
607
+ imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
654
608
  const obj = getObject(arg1);
655
609
  const ret = typeof(obj) === 'string' ? obj : undefined;
656
610
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -658,12 +612,35 @@ function __wbg_get_imports() {
658
612
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
659
613
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
660
614
  };
661
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
615
+ imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
616
+ throw new Error(getStringFromWasm0(arg0, arg1));
617
+ };
618
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
619
+ // Cast intrinsic for `Ref(String) -> Externref`.
662
620
  const ret = getStringFromWasm0(arg0, arg1);
663
621
  return addHeapObject(ret);
664
622
  };
665
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
666
- throw new Error(getStringFromWasm0(arg0, arg1));
623
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
624
+ // Cast intrinsic for `U64 -> Externref`.
625
+ const ret = BigInt.asUintN(64, arg0);
626
+ return addHeapObject(ret);
627
+ };
628
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
629
+ // Cast intrinsic for `I64 -> Externref`.
630
+ const ret = arg0;
631
+ return addHeapObject(ret);
632
+ };
633
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
634
+ // Cast intrinsic for `F64 -> Externref`.
635
+ const ret = arg0;
636
+ return addHeapObject(ret);
637
+ };
638
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
639
+ const ret = getObject(arg0);
640
+ return addHeapObject(ret);
641
+ };
642
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
643
+ takeObject(arg0);
667
644
  };
668
645
 
669
646
  return imports;
package/chai_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Songchen Tan <i@tansongchen.com>"
6
6
  ],
7
7
  "description": "汉字编码优化算法",
8
- "version": "0.2.4",
8
+ "version": "0.3.0-beta.1",
9
9
  "license": "GPL-3.0",
10
10
  "repository": {
11
11
  "type": "git",