@swc/wasm-web 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-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,5 +1,25 @@
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
+
3
23
  const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
4
24
 
5
25
  cachedTextDecoder.decode();
@@ -17,12 +37,6 @@ function getStringFromWasm0(ptr, len) {
17
37
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
18
38
  }
19
39
 
20
- const heap = new Array(128).fill(undefined);
21
-
22
- heap.push(undefined, null, true, false);
23
-
24
- let heap_next = heap.length;
25
-
26
40
  function addHeapObject(obj) {
27
41
  if (heap_next === heap.length) heap.push(heap.length + 1);
28
42
  const idx = heap_next;
@@ -32,20 +46,6 @@ function addHeapObject(obj) {
32
46
  return idx;
33
47
  }
34
48
 
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,6 +427,13 @@ 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
+ };
430
437
  imports.wbg.__wbg_new_f9876326328f45ed = function() {
431
438
  const ret = new Object();
432
439
  return addHeapObject(ret);
@@ -438,9 +445,6 @@ function getImports() {
438
445
  imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
439
446
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
440
447
  };
441
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
442
- takeObject(arg0);
443
- };
444
448
  imports.wbg.__wbg_new_b525de17f44a8943 = function() {
445
449
  const ret = new Array();
446
450
  return addHeapObject(ret);
@@ -460,6 +464,15 @@ function getImports() {
460
464
  const ret = typeof(getObject(arg0)) === 'string';
461
465
  return ret;
462
466
  };
467
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
468
+ const v = getObject(arg0);
469
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
470
+ return ret;
471
+ };
472
+ imports.wbg.__wbindgen_number_new = function(arg0) {
473
+ const ret = arg0;
474
+ return addHeapObject(ret);
475
+ };
463
476
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
464
477
  const obj = getObject(arg1);
465
478
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -468,35 +481,11 @@ function getImports() {
468
481
  getInt32Memory0()[arg0 / 4 + 1] = len0;
469
482
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
470
483
  };
471
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
472
- const ret = new Error(getStringFromWasm0(arg0, arg1));
473
- return addHeapObject(ret);
474
- };
475
- imports.wbg.__wbindgen_number_new = function(arg0) {
476
- const ret = arg0;
477
- return addHeapObject(ret);
478
- };
479
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
480
- const ret = getObject(arg0) == getObject(arg1);
481
- return ret;
482
- };
483
484
  imports.wbg.__wbindgen_is_object = function(arg0) {
484
485
  const val = getObject(arg0);
485
486
  const ret = typeof(val) === 'object' && val !== null;
486
487
  return ret;
487
488
  };
488
- imports.wbg.__wbg_entries_4e1315b774245952 = function(arg0) {
489
- const ret = Object.entries(getObject(arg0));
490
- return addHeapObject(ret);
491
- };
492
- imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
493
- const ret = getObject(arg0).length;
494
- return ret;
495
- };
496
- imports.wbg.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
497
- const ret = getObject(arg0)[arg1 >>> 0];
498
- return addHeapObject(ret);
499
- };
500
489
  imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
501
490
  const ret = getObject(arg0)[getObject(arg1)];
502
491
  return addHeapObject(ret);
@@ -509,11 +498,6 @@ function getImports() {
509
498
  const ret = getObject(arg0) in getObject(arg1);
510
499
  return ret;
511
500
  };
512
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
513
- const v = getObject(arg0);
514
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
515
- return ret;
516
- };
517
501
  imports.wbg.__wbindgen_is_bigint = function(arg0) {
518
502
  const ret = typeof(getObject(arg0)) === 'bigint';
519
503
  return ret;
@@ -546,6 +530,10 @@ function getImports() {
546
530
  const ret = Array.isArray(getObject(arg0));
547
531
  return ret;
548
532
  };
533
+ imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
534
+ const ret = getObject(arg0).length;
535
+ return ret;
536
+ };
549
537
  imports.wbg.__wbg_iterator_55f114446221aa5a = function() {
550
538
  const ret = Symbol.iterator;
551
539
  return addHeapObject(ret);
@@ -566,6 +554,18 @@ function getImports() {
566
554
  const ret = getObject(arg0).value;
567
555
  return addHeapObject(ret);
568
556
  };
557
+ imports.wbg.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
558
+ const ret = getObject(arg0)[arg1 >>> 0];
559
+ return addHeapObject(ret);
560
+ };
561
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
562
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
563
+ return addHeapObject(ret);
564
+ };
565
+ imports.wbg.__wbg_entries_4e1315b774245952 = function(arg0) {
566
+ const ret = Object.entries(getObject(arg0));
567
+ return addHeapObject(ret);
568
+ };
569
569
  imports.wbg.__wbindgen_is_null = function(arg0) {
570
570
  const ret = getObject(arg0) === null;
571
571
  return 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_wrapper18848 = function(arg0, arg1, arg2) {
738
- const ret = makeMutClosure(arg0, arg1, 241, __wbg_adapter_50);
737
+ imports.wbg.__wbindgen_closure_wrapper18890 = function(arg0, arg1, arg2) {
738
+ const ret = makeMutClosure(arg0, arg1, 236, __wbg_adapter_50);
739
739
  return addHeapObject(ret);
740
740
  };
741
741
 
package/wasm-web_bg.wasm CHANGED
Binary file