@swc/wasm-web 1.3.45 → 1.3.47

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.45",
7
+ "version": "1.3.47",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
package/wasm-web.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
  }
@@ -2838,6 +2802,42 @@ export interface Invalid extends Node, HasSpan {
2838
2802
 
2839
2803
 
2840
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
+
2840
+
2841
2841
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
2842
2842
 
2843
2843
  export interface InitOutput {
package/wasm-web.js CHANGED
@@ -1,25 +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 heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
3
  const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
24
4
 
25
5
  cachedTextDecoder.decode();
@@ -37,6 +17,12 @@ function getStringFromWasm0(ptr, len) {
37
17
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
38
18
  }
39
19
 
20
+ const heap = new Array(128).fill(undefined);
21
+
22
+ heap.push(undefined, null, true, false);
23
+
24
+ let heap_next = heap.length;
25
+
40
26
  function addHeapObject(obj) {
41
27
  if (heap_next === heap.length) heap.push(heap.length + 1);
42
28
  const idx = heap_next;
@@ -46,6 +32,20 @@ function addHeapObject(obj) {
46
32
  return idx;
47
33
  }
48
34
 
35
+ function getObject(idx) { return heap[idx]; }
36
+
37
+ function dropObject(idx) {
38
+ if (idx < 132) return;
39
+ heap[idx] = heap_next;
40
+ heap_next = idx;
41
+ }
42
+
43
+ function takeObject(idx) {
44
+ const ret = getObject(idx);
45
+ dropObject(idx);
46
+ return ret;
47
+ }
48
+
49
49
  let WASM_VECTOR_LEN = 0;
50
50
 
51
51
  const cachedTextEncoder = new TextEncoder('utf-8');
@@ -427,13 +427,6 @@ async function load(module, imports) {
427
427
  function getImports() {
428
428
  const imports = {};
429
429
  imports.wbg = {};
430
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
431
- const ret = getObject(arg0) == getObject(arg1);
432
- return ret;
433
- };
434
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
435
- takeObject(arg0);
436
- };
437
430
  imports.wbg.__wbg_new_f9876326328f45ed = function() {
438
431
  const ret = new Object();
439
432
  return addHeapObject(ret);
@@ -445,6 +438,9 @@ function getImports() {
445
438
  imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
446
439
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
447
440
  };
441
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
442
+ takeObject(arg0);
443
+ };
448
444
  imports.wbg.__wbg_new_b525de17f44a8943 = function() {
449
445
  const ret = new Array();
450
446
  return addHeapObject(ret);
@@ -464,11 +460,18 @@ function getImports() {
464
460
  const ret = typeof(getObject(arg0)) === 'string';
465
461
  return ret;
466
462
  };
467
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
468
- const v = getObject(arg0);
469
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
463
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
464
+ const ret = getObject(arg0) == getObject(arg1);
470
465
  return ret;
471
466
  };
467
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
468
+ const obj = getObject(arg1);
469
+ const ret = typeof(obj) === 'string' ? obj : undefined;
470
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
471
+ var len0 = WASM_VECTOR_LEN;
472
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
473
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
474
+ };
472
475
  imports.wbg.__wbindgen_is_object = function(arg0) {
473
476
  const val = getObject(arg0);
474
477
  const ret = typeof(val) === 'object' && val !== null;
@@ -486,62 +489,21 @@ function getImports() {
486
489
  const ret = getObject(arg0) in getObject(arg1);
487
490
  return ret;
488
491
  };
489
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
490
- const obj = getObject(arg1);
491
- const ret = typeof(obj) === 'string' ? obj : undefined;
492
- var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
493
- var len0 = WASM_VECTOR_LEN;
494
- getInt32Memory0()[arg0 / 4 + 1] = len0;
495
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
496
- };
497
- imports.wbg.__wbindgen_number_new = function(arg0) {
498
- const ret = arg0;
492
+ imports.wbg.__wbg_entries_4e1315b774245952 = function(arg0) {
493
+ const ret = Object.entries(getObject(arg0));
499
494
  return addHeapObject(ret);
500
495
  };
501
- imports.wbg.__wbindgen_is_null = function(arg0) {
502
- const ret = getObject(arg0) === null;
503
- return ret;
504
- };
505
- imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
506
- try {
507
- var state0 = {a: arg0, b: arg1};
508
- var cb0 = (arg0, arg1) => {
509
- const a = state0.a;
510
- state0.a = 0;
511
- try {
512
- return __wbg_adapter_110(a, state0.b, arg0, arg1);
513
- } finally {
514
- state0.a = a;
515
- }
516
- };
517
- const ret = new Promise(cb0);
518
- return addHeapObject(ret);
519
- } finally {
520
- state0.a = state0.b = 0;
521
- }
522
- };
523
- imports.wbg.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
524
- const ret = getObject(arg0).next();
525
- return addHeapObject(ret);
526
- }, arguments) };
527
- imports.wbg.__wbg_done_1ebec03bbd919843 = function(arg0) {
528
- const ret = getObject(arg0).done;
496
+ imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
497
+ const ret = getObject(arg0).length;
529
498
  return ret;
530
499
  };
531
- imports.wbg.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
532
- const ret = getObject(arg0).value;
533
- return addHeapObject(ret);
534
- };
535
500
  imports.wbg.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
536
501
  const ret = getObject(arg0)[arg1 >>> 0];
537
502
  return addHeapObject(ret);
538
503
  };
539
- imports.wbg.__wbg_entries_4e1315b774245952 = function(arg0) {
540
- const ret = Object.entries(getObject(arg0));
541
- return addHeapObject(ret);
542
- };
543
- imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
544
- const ret = getObject(arg0).length;
504
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
505
+ const v = getObject(arg0);
506
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
545
507
  return ret;
546
508
  };
547
509
  imports.wbg.__wbindgen_is_bigint = function(arg0) {
@@ -584,10 +546,48 @@ function getImports() {
584
546
  const ret = BigInt.asUintN(64, arg0);
585
547
  return addHeapObject(ret);
586
548
  };
549
+ imports.wbg.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
550
+ const ret = getObject(arg0).next();
551
+ return addHeapObject(ret);
552
+ }, arguments) };
553
+ imports.wbg.__wbg_done_1ebec03bbd919843 = function(arg0) {
554
+ const ret = getObject(arg0).done;
555
+ return ret;
556
+ };
557
+ imports.wbg.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
558
+ const ret = getObject(arg0).value;
559
+ return addHeapObject(ret);
560
+ };
561
+ imports.wbg.__wbindgen_number_new = function(arg0) {
562
+ const ret = arg0;
563
+ return addHeapObject(ret);
564
+ };
587
565
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
588
566
  const ret = new Error(getStringFromWasm0(arg0, arg1));
589
567
  return addHeapObject(ret);
590
568
  };
569
+ imports.wbg.__wbindgen_is_null = function(arg0) {
570
+ const ret = getObject(arg0) === null;
571
+ return ret;
572
+ };
573
+ imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
574
+ try {
575
+ var state0 = {a: arg0, b: arg1};
576
+ var cb0 = (arg0, arg1) => {
577
+ const a = state0.a;
578
+ state0.a = 0;
579
+ try {
580
+ return __wbg_adapter_110(a, state0.b, arg0, arg1);
581
+ } finally {
582
+ state0.a = a;
583
+ }
584
+ };
585
+ const ret = new Promise(cb0);
586
+ return addHeapObject(ret);
587
+ } finally {
588
+ state0.a = state0.b = 0;
589
+ }
590
+ };
591
591
  imports.wbg.__wbg_call_9495de66fdbe016b = function() { return handleError(function (arg0, arg1, arg2) {
592
592
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
593
593
  return addHeapObject(ret);
@@ -734,8 +734,8 @@ imports.wbg.__wbindgen_cb_drop = function(arg0) {
734
734
  const ret = false;
735
735
  return ret;
736
736
  };
737
- imports.wbg.__wbindgen_closure_wrapper18920 = function(arg0, arg1, arg2) {
738
- const ret = makeMutClosure(arg0, arg1, 240, __wbg_adapter_50);
737
+ imports.wbg.__wbindgen_closure_wrapper19045 = function(arg0, arg1, arg2) {
738
+ const ret = makeMutClosure(arg0, arg1, 238, __wbg_adapter_50);
739
739
  return addHeapObject(ret);
740
740
  };
741
741
 
package/wasm-web_bg.wasm CHANGED
Binary file