@swc/wasm 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 +1 -1
- package/wasm.d.ts +36 -36
- package/wasm.js +88 -88
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
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,26 +3,6 @@ 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
|
-
|
|
26
6
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
27
7
|
|
|
28
8
|
cachedTextDecoder.decode();
|
|
@@ -40,6 +20,12 @@ function getStringFromWasm0(ptr, len) {
|
|
|
40
20
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
41
21
|
}
|
|
42
22
|
|
|
23
|
+
const heap = new Array(128).fill(undefined);
|
|
24
|
+
|
|
25
|
+
heap.push(undefined, null, true, false);
|
|
26
|
+
|
|
27
|
+
let heap_next = heap.length;
|
|
28
|
+
|
|
43
29
|
function addHeapObject(obj) {
|
|
44
30
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
31
|
const idx = heap_next;
|
|
@@ -49,6 +35,20 @@ function addHeapObject(obj) {
|
|
|
49
35
|
return idx;
|
|
50
36
|
}
|
|
51
37
|
|
|
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,15 +396,6 @@ 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
|
-
|
|
408
399
|
module.exports.__wbg_new_f9876326328f45ed = function() {
|
|
409
400
|
const ret = new Object();
|
|
410
401
|
return addHeapObject(ret);
|
|
@@ -419,6 +410,10 @@ module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
|
|
|
419
410
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
420
411
|
};
|
|
421
412
|
|
|
413
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
414
|
+
takeObject(arg0);
|
|
415
|
+
};
|
|
416
|
+
|
|
422
417
|
module.exports.__wbg_new_b525de17f44a8943 = function() {
|
|
423
418
|
const ret = new Array();
|
|
424
419
|
return addHeapObject(ret);
|
|
@@ -443,12 +438,20 @@ module.exports.__wbindgen_is_string = function(arg0) {
|
|
|
443
438
|
return ret;
|
|
444
439
|
};
|
|
445
440
|
|
|
446
|
-
module.exports.
|
|
447
|
-
const
|
|
448
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
441
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
442
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
449
443
|
return ret;
|
|
450
444
|
};
|
|
451
445
|
|
|
446
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
447
|
+
const obj = getObject(arg1);
|
|
448
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
449
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
450
|
+
var len0 = WASM_VECTOR_LEN;
|
|
451
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
452
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
453
|
+
};
|
|
454
|
+
|
|
452
455
|
module.exports.__wbindgen_is_object = function(arg0) {
|
|
453
456
|
const val = getObject(arg0);
|
|
454
457
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -470,71 +473,24 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
|
470
473
|
return ret;
|
|
471
474
|
};
|
|
472
475
|
|
|
473
|
-
module.exports.
|
|
474
|
-
const
|
|
475
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
476
|
-
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
477
|
-
var len0 = WASM_VECTOR_LEN;
|
|
478
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
479
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
module.exports.__wbindgen_number_new = function(arg0) {
|
|
483
|
-
const ret = arg0;
|
|
476
|
+
module.exports.__wbg_entries_4e1315b774245952 = function(arg0) {
|
|
477
|
+
const ret = Object.entries(getObject(arg0));
|
|
484
478
|
return addHeapObject(ret);
|
|
485
479
|
};
|
|
486
480
|
|
|
487
|
-
module.exports.
|
|
488
|
-
const ret = getObject(arg0)
|
|
489
|
-
return ret;
|
|
490
|
-
};
|
|
491
|
-
|
|
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
|
-
}
|
|
509
|
-
};
|
|
510
|
-
|
|
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;
|
|
481
|
+
module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
|
|
482
|
+
const ret = getObject(arg0).length;
|
|
518
483
|
return ret;
|
|
519
484
|
};
|
|
520
485
|
|
|
521
|
-
module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
|
|
522
|
-
const ret = getObject(arg0).value;
|
|
523
|
-
return addHeapObject(ret);
|
|
524
|
-
};
|
|
525
|
-
|
|
526
486
|
module.exports.__wbg_get_27fe3dac1c4d0224 = function(arg0, arg1) {
|
|
527
487
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
528
488
|
return addHeapObject(ret);
|
|
529
489
|
};
|
|
530
490
|
|
|
531
|
-
module.exports.
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
|
|
537
|
-
const ret = getObject(arg0).length;
|
|
491
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
492
|
+
const v = getObject(arg0);
|
|
493
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
538
494
|
return ret;
|
|
539
495
|
};
|
|
540
496
|
|
|
@@ -587,11 +543,55 @@ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
|
587
543
|
return addHeapObject(ret);
|
|
588
544
|
};
|
|
589
545
|
|
|
546
|
+
module.exports.__wbg_next_88560ec06a094dea = function() { return handleError(function (arg0) {
|
|
547
|
+
const ret = getObject(arg0).next();
|
|
548
|
+
return addHeapObject(ret);
|
|
549
|
+
}, arguments) };
|
|
550
|
+
|
|
551
|
+
module.exports.__wbg_done_1ebec03bbd919843 = function(arg0) {
|
|
552
|
+
const ret = getObject(arg0).done;
|
|
553
|
+
return ret;
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
|
|
557
|
+
const ret = getObject(arg0).value;
|
|
558
|
+
return addHeapObject(ret);
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
562
|
+
const ret = arg0;
|
|
563
|
+
return addHeapObject(ret);
|
|
564
|
+
};
|
|
565
|
+
|
|
590
566
|
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
591
567
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
592
568
|
return addHeapObject(ret);
|
|
593
569
|
};
|
|
594
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);
|
|
@@ -768,8 +768,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
768
768
|
return ret;
|
|
769
769
|
};
|
|
770
770
|
|
|
771
|
-
module.exports.
|
|
772
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
771
|
+
module.exports.__wbindgen_closure_wrapper19045 = function(arg0, arg1, arg2) {
|
|
772
|
+
const ret = makeMutClosure(arg0, arg1, 238, __wbg_adapter_50);
|
|
773
773
|
return addHeapObject(ret);
|
|
774
774
|
};
|
|
775
775
|
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|