@swc/wasm 1.3.43 → 1.3.44

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
@@ -4,7 +4,7 @@
4
4
  "강동윤 <kdy1997.dev@gmail.com>"
5
5
  ],
6
6
  "description": "wasm module for swc",
7
- "version": "1.3.43",
7
+ "version": "1.3.44",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
package/wasm.d.ts CHANGED
@@ -7,42 +7,6 @@
7
7
  */
8
8
  export function browserslist(query: string, opts: any): any;
9
9
 
10
- export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
11
- export function minifySync(code: string, opts?: JsMinifyOptions): Output;
12
-
13
- export function parse(src: string, options: ParseOptions & {
14
- isModule: false;
15
- }): Promise<Script>;
16
- export function parse(src: string, options?: ParseOptions): Promise<Module>;
17
- export function parseSync(src: string, options: ParseOptions & {
18
- isModule: false;
19
- }): Script;
20
- export function parseSync(src: string, options?: ParseOptions): Module;
21
-
22
- export function print(m: Program, options?: Options): Promise<Output>;
23
- export function printSync(m: Program, options?: Options): Output
24
-
25
- /**
26
- * Note: this interface currently does not do _actual_ async work, only provides
27
- * a corresponding async interfaces to the `@swc/core`'s interface.
28
- */
29
- export function transform(
30
- code: string | Program,
31
- options?: Options,
32
- experimental_plugin_bytes_resolver?: any
33
- ): Promise<Output>;
34
- /**
35
- * @param {string} code
36
- * @param {Options} opts
37
- * @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
38
- * specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
39
- * interface, likely will change.
40
- * @returns {Output}
41
- */
42
- export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
43
-
44
-
45
-
46
10
  export interface Plugin {
47
11
  (module: Program): Program;
48
12
  }
@@ -2837,3 +2801,39 @@ export interface Invalid extends Node, HasSpan {
2837
2801
  }
2838
2802
 
2839
2803
 
2804
+
2805
+ export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
2806
+ export function minifySync(code: string, opts?: JsMinifyOptions): Output;
2807
+
2808
+ export function parse(src: string, options: ParseOptions & {
2809
+ isModule: false;
2810
+ }): Promise<Script>;
2811
+ export function parse(src: string, options?: ParseOptions): Promise<Module>;
2812
+ export function parseSync(src: string, options: ParseOptions & {
2813
+ isModule: false;
2814
+ }): Script;
2815
+ export function parseSync(src: string, options?: ParseOptions): Module;
2816
+
2817
+ export function print(m: Program, options?: Options): Promise<Output>;
2818
+ export function printSync(m: Program, options?: Options): Output
2819
+
2820
+ /**
2821
+ * Note: this interface currently does not do _actual_ async work, only provides
2822
+ * a corresponding async interfaces to the `@swc/core`'s interface.
2823
+ */
2824
+ export function transform(
2825
+ code: string | Program,
2826
+ options?: Options,
2827
+ experimental_plugin_bytes_resolver?: any
2828
+ ): Promise<Output>;
2829
+ /**
2830
+ * @param {string} code
2831
+ * @param {Options} opts
2832
+ * @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
2833
+ * specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
2834
+ * interface, likely will change.
2835
+ * @returns {Output}
2836
+ */
2837
+ export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
2838
+
2839
+
package/wasm.js CHANGED
@@ -3,6 +3,26 @@ imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
4
  const { TextDecoder, TextEncoder } = require(`util`);
5
5
 
6
+ const heap = new Array(128).fill(undefined);
7
+
8
+ heap.push(undefined, null, true, false);
9
+
10
+ function getObject(idx) { return heap[idx]; }
11
+
12
+ let heap_next = heap.length;
13
+
14
+ function dropObject(idx) {
15
+ if (idx < 132) return;
16
+ heap[idx] = heap_next;
17
+ heap_next = idx;
18
+ }
19
+
20
+ function takeObject(idx) {
21
+ const ret = getObject(idx);
22
+ dropObject(idx);
23
+ return ret;
24
+ }
25
+
6
26
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
7
27
 
8
28
  cachedTextDecoder.decode();
@@ -20,12 +40,6 @@ function getStringFromWasm0(ptr, len) {
20
40
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
21
41
  }
22
42
 
23
- const heap = new Array(128).fill(undefined);
24
-
25
- heap.push(undefined, null, true, false);
26
-
27
- let heap_next = heap.length;
28
-
29
43
  function addHeapObject(obj) {
30
44
  if (heap_next === heap.length) heap.push(heap.length + 1);
31
45
  const idx = heap_next;
@@ -35,20 +49,6 @@ function addHeapObject(obj) {
35
49
  return idx;
36
50
  }
37
51
 
38
- function getObject(idx) { return heap[idx]; }
39
-
40
- function dropObject(idx) {
41
- if (idx < 132) return;
42
- heap[idx] = heap_next;
43
- heap_next = idx;
44
- }
45
-
46
- function takeObject(idx) {
47
- const ret = getObject(idx);
48
- dropObject(idx);
49
- return ret;
50
- }
51
-
52
52
  let WASM_VECTOR_LEN = 0;
53
53
 
54
54
  let cachedTextEncoder = new TextEncoder('utf-8');
@@ -396,6 +396,15 @@ function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
396
396
  wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
397
397
  }
398
398
 
399
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
400
+ const ret = getObject(arg0) == getObject(arg1);
401
+ return ret;
402
+ };
403
+
404
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
405
+ takeObject(arg0);
406
+ };
407
+
399
408
  module.exports.__wbg_new_f9876326328f45ed = function() {
400
409
  const ret = new Object();
401
410
  return addHeapObject(ret);
@@ -410,10 +419,6 @@ module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
410
419
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
411
420
  };
412
421
 
413
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
414
- takeObject(arg0);
415
- };
416
-
417
422
  module.exports.__wbg_new_b525de17f44a8943 = function() {
418
423
  const ret = new Array();
419
424
  return addHeapObject(ret);
@@ -438,18 +443,10 @@ module.exports.__wbindgen_is_string = function(arg0) {
438
443
  return ret;
439
444
  };
440
445
 
441
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
442
- const obj = getObject(arg1);
443
- const ret = typeof(obj) === 'string' ? obj : undefined;
444
- var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
445
- var len0 = WASM_VECTOR_LEN;
446
- getInt32Memory0()[arg0 / 4 + 1] = len0;
447
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
448
- };
449
-
450
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
451
- const ret = new Error(getStringFromWasm0(arg0, arg1));
452
- return addHeapObject(ret);
446
+ module.exports.__wbindgen_boolean_get = function(arg0) {
447
+ const v = getObject(arg0);
448
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
449
+ return ret;
453
450
  };
454
451
 
455
452
  module.exports.__wbindgen_number_new = function(arg0) {
@@ -457,9 +454,13 @@ module.exports.__wbindgen_number_new = function(arg0) {
457
454
  return addHeapObject(ret);
458
455
  };
459
456
 
460
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
461
- const ret = getObject(arg0) == getObject(arg1);
462
- return ret;
457
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
458
+ const obj = getObject(arg1);
459
+ const ret = typeof(obj) === 'string' ? obj : undefined;
460
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
461
+ var len0 = WASM_VECTOR_LEN;
462
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
463
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
463
464
  };
464
465
 
465
466
  module.exports.__wbindgen_is_object = function(arg0) {
@@ -468,21 +469,6 @@ module.exports.__wbindgen_is_object = function(arg0) {
468
469
  return ret;
469
470
  };
470
471
 
471
- module.exports.__wbg_entries_4e1315b774245952 = function(arg0) {
472
- const ret = Object.entries(getObject(arg0));
473
- return addHeapObject(ret);
474
- };
475
-
476
- module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
477
- const ret = getObject(arg0).length;
478
- return ret;
479
- };
480
-
481
- module.exports.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
482
- const ret = getObject(arg0)[arg1 >>> 0];
483
- return addHeapObject(ret);
484
- };
485
-
486
472
  module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
487
473
  const ret = getObject(arg0)[getObject(arg1)];
488
474
  return addHeapObject(ret);
@@ -498,12 +484,6 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
498
484
  return ret;
499
485
  };
500
486
 
501
- module.exports.__wbindgen_boolean_get = function(arg0) {
502
- const v = getObject(arg0);
503
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
504
- return ret;
505
- };
506
-
507
487
  module.exports.__wbindgen_is_bigint = function(arg0) {
508
488
  const ret = typeof(getObject(arg0)) === 'bigint';
509
489
  return ret;
@@ -543,6 +523,11 @@ module.exports.__wbg_isArray_39d28997bf6b96b4 = function(arg0) {
543
523
  return ret;
544
524
  };
545
525
 
526
+ module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
527
+ const ret = getObject(arg0).length;
528
+ return ret;
529
+ };
530
+
546
531
  module.exports.__wbg_iterator_55f114446221aa5a = function() {
547
532
  const ret = Symbol.iterator;
548
533
  return addHeapObject(ret);
@@ -568,6 +553,21 @@ module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
568
553
  return addHeapObject(ret);
569
554
  };
570
555
 
556
+ module.exports.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
557
+ const ret = getObject(arg0)[arg1 >>> 0];
558
+ return addHeapObject(ret);
559
+ };
560
+
561
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
562
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
563
+ return addHeapObject(ret);
564
+ };
565
+
566
+ module.exports.__wbg_entries_4e1315b774245952 = function(arg0) {
567
+ const ret = Object.entries(getObject(arg0));
568
+ return addHeapObject(ret);
569
+ };
570
+
571
571
  module.exports.__wbindgen_is_null = function(arg0) {
572
572
  const ret = getObject(arg0) === null;
573
573
  return ret;
@@ -768,8 +768,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
768
768
  return ret;
769
769
  };
770
770
 
771
- module.exports.__wbindgen_closure_wrapper18848 = function(arg0, arg1, arg2) {
772
- const ret = makeMutClosure(arg0, arg1, 241, __wbg_adapter_50);
771
+ module.exports.__wbindgen_closure_wrapper18890 = function(arg0, arg1, arg2) {
772
+ const ret = makeMutClosure(arg0, arg1, 236, __wbg_adapter_50);
773
773
  return addHeapObject(ret);
774
774
  };
775
775
 
package/wasm_bg.wasm CHANGED
Binary file