@swc/wasm 1.3.44 → 1.3.46

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.44",
7
+ "version": "1.3.46",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
package/wasm.d.ts CHANGED
@@ -7,6 +7,42 @@
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
+
10
46
  export interface Plugin {
11
47
  (module: Program): Program;
12
48
  }
@@ -996,11 +1032,11 @@ export interface BaseModuleConfig {
996
1032
  *
997
1033
  * "use strict";
998
1034
  *
999
- * function _interopRequireDefault(obj) {
1035
+ * function _interop_require_default(obj) {
1000
1036
  * return obj && obj.__esModule ? obj : { default: obj };
1001
1037
  * }
1002
1038
  *
1003
- * var _foo = _interopRequireDefault(require("foo"));
1039
+ * var _foo = _interop_require_default(require("foo"));
1004
1040
  * var _bar = require("bar");
1005
1041
  *
1006
1042
  * _foo.default;
@@ -1040,7 +1076,7 @@ export interface BaseModuleConfig {
1040
1076
  * - `none`
1041
1077
  *
1042
1078
  * If you know that the imported file has been transformed with a compiler that stores the `default` export on
1043
- * `exports.default` (such as swc or Babel), you can safely omit the `_interopRequireDefault` helper.
1079
+ * `exports.default` (such as swc or Babel), you can safely omit the `_interop_require_default` helper.
1044
1080
  *
1045
1081
  * ```javascript
1046
1082
  * import foo from "foo";
@@ -2801,39 +2837,3 @@ export interface Invalid extends Node, HasSpan {
2801
2837
  }
2802
2838
 
2803
2839
 
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
@@ -449,11 +449,27 @@ module.exports.__wbindgen_boolean_get = function(arg0) {
449
449
  return ret;
450
450
  };
451
451
 
452
- module.exports.__wbindgen_number_new = function(arg0) {
453
- const ret = arg0;
452
+ module.exports.__wbindgen_is_object = function(arg0) {
453
+ const val = getObject(arg0);
454
+ const ret = typeof(val) === 'object' && val !== null;
455
+ return ret;
456
+ };
457
+
458
+ module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
459
+ const ret = getObject(arg0)[getObject(arg1)];
454
460
  return addHeapObject(ret);
455
461
  };
456
462
 
463
+ module.exports.__wbindgen_is_undefined = function(arg0) {
464
+ const ret = getObject(arg0) === undefined;
465
+ return ret;
466
+ };
467
+
468
+ module.exports.__wbindgen_in = function(arg0, arg1) {
469
+ const ret = getObject(arg0) in getObject(arg1);
470
+ return ret;
471
+ };
472
+
457
473
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
458
474
  const obj = getObject(arg1);
459
475
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -463,24 +479,62 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
463
479
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
464
480
  };
465
481
 
466
- module.exports.__wbindgen_is_object = function(arg0) {
467
- const val = getObject(arg0);
468
- const ret = typeof(val) === 'object' && val !== null;
482
+ module.exports.__wbindgen_number_new = function(arg0) {
483
+ const ret = arg0;
484
+ return addHeapObject(ret);
485
+ };
486
+
487
+ module.exports.__wbindgen_is_null = function(arg0) {
488
+ const ret = getObject(arg0) === null;
469
489
  return ret;
470
490
  };
471
491
 
472
- module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
473
- const ret = getObject(arg0)[getObject(arg1)];
474
- return addHeapObject(ret);
492
+ module.exports.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
493
+ try {
494
+ var state0 = {a: arg0, b: arg1};
495
+ var cb0 = (arg0, arg1) => {
496
+ const a = state0.a;
497
+ state0.a = 0;
498
+ try {
499
+ return __wbg_adapter_110(a, state0.b, arg0, arg1);
500
+ } finally {
501
+ state0.a = a;
502
+ }
503
+ };
504
+ const ret = new Promise(cb0);
505
+ return addHeapObject(ret);
506
+ } finally {
507
+ state0.a = state0.b = 0;
508
+ }
475
509
  };
476
510
 
477
- module.exports.__wbindgen_is_undefined = function(arg0) {
478
- const ret = getObject(arg0) === undefined;
511
+ module.exports.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
512
+ const ret = getObject(arg0).next();
513
+ return addHeapObject(ret);
514
+ }, arguments) };
515
+
516
+ module.exports.__wbg_done_1ebec03bbd919843 = function(arg0) {
517
+ const ret = getObject(arg0).done;
479
518
  return ret;
480
519
  };
481
520
 
482
- module.exports.__wbindgen_in = function(arg0, arg1) {
483
- const ret = getObject(arg0) in getObject(arg1);
521
+ module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
522
+ const ret = getObject(arg0).value;
523
+ return addHeapObject(ret);
524
+ };
525
+
526
+ module.exports.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
527
+ const ret = getObject(arg0)[arg1 >>> 0];
528
+ return addHeapObject(ret);
529
+ };
530
+
531
+ module.exports.__wbg_entries_4e1315b774245952 = function(arg0) {
532
+ const ret = Object.entries(getObject(arg0));
533
+ return addHeapObject(ret);
534
+ };
535
+
536
+ module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
537
+ const ret = getObject(arg0).length;
484
538
  return ret;
485
539
  };
486
540
 
@@ -523,11 +577,6 @@ module.exports.__wbg_isArray_39d28997bf6b96b4 = function(arg0) {
523
577
  return ret;
524
578
  };
525
579
 
526
- module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
527
- const ret = getObject(arg0).length;
528
- return ret;
529
- };
530
-
531
580
  module.exports.__wbg_iterator_55f114446221aa5a = function() {
532
581
  const ret = Symbol.iterator;
533
582
  return addHeapObject(ret);
@@ -538,60 +587,11 @@ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
538
587
  return addHeapObject(ret);
539
588
  };
540
589
 
541
- module.exports.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
542
- const ret = getObject(arg0).next();
543
- return addHeapObject(ret);
544
- }, arguments) };
545
-
546
- module.exports.__wbg_done_1ebec03bbd919843 = function(arg0) {
547
- const ret = getObject(arg0).done;
548
- return ret;
549
- };
550
-
551
- module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
552
- const ret = getObject(arg0).value;
553
- return addHeapObject(ret);
554
- };
555
-
556
- module.exports.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
557
- const ret = getObject(arg0)[arg1 >>> 0];
558
- return addHeapObject(ret);
559
- };
560
-
561
590
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
562
591
  const ret = new Error(getStringFromWasm0(arg0, arg1));
563
592
  return addHeapObject(ret);
564
593
  };
565
594
 
566
- module.exports.__wbg_entries_4e1315b774245952 = function(arg0) {
567
- const ret = Object.entries(getObject(arg0));
568
- return addHeapObject(ret);
569
- };
570
-
571
- module.exports.__wbindgen_is_null = function(arg0) {
572
- const ret = getObject(arg0) === null;
573
- return ret;
574
- };
575
-
576
- module.exports.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
577
- try {
578
- var state0 = {a: arg0, b: arg1};
579
- var cb0 = (arg0, arg1) => {
580
- const a = state0.a;
581
- state0.a = 0;
582
- try {
583
- return __wbg_adapter_110(a, state0.b, arg0, arg1);
584
- } finally {
585
- state0.a = a;
586
- }
587
- };
588
- const ret = new Promise(cb0);
589
- return addHeapObject(ret);
590
- } finally {
591
- state0.a = state0.b = 0;
592
- }
593
- };
594
-
595
595
  module.exports.__wbg_call_9495de66fdbe016b = function() { return handleError(function (arg0, arg1, arg2) {
596
596
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
597
597
  return addHeapObject(ret);
@@ -706,14 +706,6 @@ module.exports.__wbg_set_17499e8aa4003ebd = function(arg0, arg1, arg2) {
706
706
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
707
707
  };
708
708
 
709
- module.exports.__wbindgen_debug_string = function(arg0, arg1) {
710
- const ret = debugString(getObject(arg1));
711
- const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
712
- const len0 = WASM_VECTOR_LEN;
713
- getInt32Memory0()[arg0 / 4 + 1] = len0;
714
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
715
- };
716
-
717
709
  module.exports.__wbg_instanceof_Uint8Array_01cebe79ca606cca = function(arg0) {
718
710
  let result;
719
711
  try {
@@ -744,6 +736,14 @@ module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
744
736
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
745
737
  };
746
738
 
739
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
740
+ const ret = debugString(getObject(arg1));
741
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
742
+ const len0 = WASM_VECTOR_LEN;
743
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
744
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
745
+ };
746
+
747
747
  module.exports.__wbindgen_throw = function(arg0, arg1) {
748
748
  throw new Error(getStringFromWasm0(arg0, arg1));
749
749
  };
@@ -768,8 +768,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
768
768
  return ret;
769
769
  };
770
770
 
771
- module.exports.__wbindgen_closure_wrapper18890 = function(arg0, arg1, arg2) {
772
- const ret = makeMutClosure(arg0, arg1, 236, __wbg_adapter_50);
771
+ module.exports.__wbindgen_closure_wrapper18908 = function(arg0, arg1, arg2) {
772
+ const ret = makeMutClosure(arg0, arg1, 239, __wbg_adapter_50);
773
773
  return addHeapObject(ret);
774
774
  };
775
775
 
package/wasm_bg.wasm CHANGED
Binary file