@swc/wasm 1.2.226 → 1.2.227
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 +58 -58
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.d.ts
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
|
|
5
|
+
export function minifySync(code: string, opts?: JsMinifyOptions): Output;
|
|
6
|
+
|
|
7
|
+
export function parse(src: string, options: ParseOptions & {
|
|
8
|
+
isModule: false;
|
|
9
|
+
}): Promise<Script>;
|
|
10
|
+
export function parse(src: string, options?: ParseOptions): Promise<Module>;
|
|
11
|
+
export function parseSync(src: string, options: ParseOptions & {
|
|
12
|
+
isModule: false;
|
|
13
|
+
}): Script;
|
|
14
|
+
export function parseSync(src: string, options?: ParseOptions): Module;
|
|
15
|
+
|
|
16
|
+
export function print(m: Program, options?: Options): Promise<Output>;
|
|
17
|
+
export function printSync(m: Program, options?: Options): Output
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Note: this interface currently does not do _actual_ async work, only provides
|
|
21
|
+
* a corresponding async interfaces to the `@swc/core`'s interface.
|
|
22
|
+
*/
|
|
23
|
+
export function transform(
|
|
24
|
+
code: string | Program,
|
|
25
|
+
options?: Options,
|
|
26
|
+
experimental_plugin_bytes_resolver?: any
|
|
27
|
+
): Promise<Output>;
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} code
|
|
30
|
+
* @param {Options} opts
|
|
31
|
+
* @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
|
|
32
|
+
* specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
|
|
33
|
+
* interface, likely will change.
|
|
34
|
+
* @returns {Output}
|
|
35
|
+
*/
|
|
36
|
+
export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
4
40
|
export interface Plugin {
|
|
5
41
|
(module: Program): Program;
|
|
6
42
|
}
|
|
@@ -2789,39 +2825,3 @@ export interface Invalid extends Node, HasSpan {
|
|
|
2789
2825
|
}
|
|
2790
2826
|
|
|
2791
2827
|
|
|
2792
|
-
|
|
2793
|
-
export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
|
|
2794
|
-
export function minifySync(code: string, opts?: JsMinifyOptions): Output;
|
|
2795
|
-
|
|
2796
|
-
export function parse(src: string, options: ParseOptions & {
|
|
2797
|
-
isModule: false;
|
|
2798
|
-
}): Promise<Script>;
|
|
2799
|
-
export function parse(src: string, options?: ParseOptions): Promise<Module>;
|
|
2800
|
-
export function parseSync(src: string, options: ParseOptions & {
|
|
2801
|
-
isModule: false;
|
|
2802
|
-
}): Script;
|
|
2803
|
-
export function parseSync(src: string, options?: ParseOptions): Module;
|
|
2804
|
-
|
|
2805
|
-
export function print(m: Program, options?: Options): Promise<Output>;
|
|
2806
|
-
export function printSync(m: Program, options?: Options): Output
|
|
2807
|
-
|
|
2808
|
-
/**
|
|
2809
|
-
* Note: this interface currently does not do _actual_ async work, only provides
|
|
2810
|
-
* a corresponding async interfaces to the `@swc/core`'s interface.
|
|
2811
|
-
*/
|
|
2812
|
-
export function transform(
|
|
2813
|
-
code: string | Program,
|
|
2814
|
-
options?: Options,
|
|
2815
|
-
experimental_plugin_bytes_resolver?: any
|
|
2816
|
-
): Promise<Output>;
|
|
2817
|
-
/**
|
|
2818
|
-
* @param {string} code
|
|
2819
|
-
* @param {Options} opts
|
|
2820
|
-
* @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
|
|
2821
|
-
* specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
|
|
2822
|
-
* interface, likely will change.
|
|
2823
|
-
* @returns {Output}
|
|
2824
|
-
*/
|
|
2825
|
-
export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
|
|
2826
|
-
|
|
2827
|
-
|
package/wasm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
-
const {
|
|
4
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
5
5
|
|
|
6
6
|
const heap = new Array(32).fill(undefined);
|
|
7
7
|
|
|
@@ -23,7 +23,9 @@ function takeObject(idx) {
|
|
|
23
23
|
return ret;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
let
|
|
26
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
27
|
+
|
|
28
|
+
cachedTextDecoder.decode();
|
|
27
29
|
|
|
28
30
|
let cachedUint8Memory0 = new Uint8Array();
|
|
29
31
|
|
|
@@ -34,6 +36,21 @@ function getUint8Memory0() {
|
|
|
34
36
|
return cachedUint8Memory0;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
function getStringFromWasm0(ptr, len) {
|
|
40
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function addHeapObject(obj) {
|
|
44
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
|
+
const idx = heap_next;
|
|
46
|
+
heap_next = heap[idx];
|
|
47
|
+
|
|
48
|
+
heap[idx] = obj;
|
|
49
|
+
return idx;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let WASM_VECTOR_LEN = 0;
|
|
53
|
+
|
|
37
54
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
38
55
|
|
|
39
56
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -87,10 +104,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
87
104
|
return ptr;
|
|
88
105
|
}
|
|
89
106
|
|
|
90
|
-
function isLikeNone(x) {
|
|
91
|
-
return x === undefined || x === null;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
107
|
let cachedInt32Memory0 = new Int32Array();
|
|
95
108
|
|
|
96
109
|
function getInt32Memory0() {
|
|
@@ -100,21 +113,8 @@ function getInt32Memory0() {
|
|
|
100
113
|
return cachedInt32Memory0;
|
|
101
114
|
}
|
|
102
115
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
cachedTextDecoder.decode();
|
|
106
|
-
|
|
107
|
-
function getStringFromWasm0(ptr, len) {
|
|
108
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function addHeapObject(obj) {
|
|
112
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
113
|
-
const idx = heap_next;
|
|
114
|
-
heap_next = heap[idx];
|
|
115
|
-
|
|
116
|
-
heap[idx] = obj;
|
|
117
|
-
return idx;
|
|
116
|
+
function isLikeNone(x) {
|
|
117
|
+
return x === undefined || x === null;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
@@ -142,7 +142,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
142
142
|
return real;
|
|
143
143
|
}
|
|
144
144
|
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
145
|
-
wasm.
|
|
145
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a066990b442725f(arg0, arg1, addHeapObject(arg2));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
@@ -287,27 +287,18 @@ function handleError(f, args) {
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
function __wbg_adapter_45(arg0, arg1, arg2, arg3) {
|
|
290
|
-
wasm.
|
|
290
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h48d92760bcda3ab6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
module.exports.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
294
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
295
|
+
return addHeapObject(ret);
|
|
296
|
+
}, arguments) };
|
|
297
|
+
|
|
293
298
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
294
299
|
takeObject(arg0);
|
|
295
300
|
};
|
|
296
301
|
|
|
297
|
-
module.exports.__wbindgen_is_string = function(arg0) {
|
|
298
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
299
|
-
return ret;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
303
|
-
const obj = getObject(arg1);
|
|
304
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
305
|
-
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
|
-
var len0 = WASM_VECTOR_LEN;
|
|
307
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
308
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
302
|
module.exports.__wbindgen_is_null = function(arg0) {
|
|
312
303
|
const ret = getObject(arg0) === null;
|
|
313
304
|
return ret;
|
|
@@ -318,25 +309,6 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
|
318
309
|
return ret;
|
|
319
310
|
};
|
|
320
311
|
|
|
321
|
-
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
322
|
-
const obj = getObject(arg1);
|
|
323
|
-
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
324
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
325
|
-
const len0 = WASM_VECTOR_LEN;
|
|
326
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
327
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
|
|
331
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
332
|
-
return addHeapObject(ret);
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
module.exports.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
336
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
337
|
-
return addHeapObject(ret);
|
|
338
|
-
}, arguments) };
|
|
339
|
-
|
|
340
312
|
module.exports.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
|
|
341
313
|
try {
|
|
342
314
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -356,6 +328,34 @@ module.exports.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
|
|
|
356
328
|
}
|
|
357
329
|
};
|
|
358
330
|
|
|
331
|
+
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
|
|
332
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
333
|
+
return addHeapObject(ret);
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
337
|
+
const obj = getObject(arg1);
|
|
338
|
+
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
339
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
340
|
+
const len0 = WASM_VECTOR_LEN;
|
|
341
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
342
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
346
|
+
const obj = getObject(arg1);
|
|
347
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
348
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
349
|
+
var len0 = WASM_VECTOR_LEN;
|
|
350
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
351
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
355
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
356
|
+
return ret;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
359
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
360
360
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
361
361
|
return addHeapObject(ret);
|
|
@@ -419,8 +419,8 @@ module.exports.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
|
|
|
419
419
|
return addHeapObject(ret);
|
|
420
420
|
};
|
|
421
421
|
|
|
422
|
-
module.exports.
|
|
423
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
422
|
+
module.exports.__wbindgen_closure_wrapper14517 = function(arg0, arg1, arg2) {
|
|
423
|
+
const ret = makeMutClosure(arg0, arg1, 148, __wbg_adapter_22);
|
|
424
424
|
return addHeapObject(ret);
|
|
425
425
|
};
|
|
426
426
|
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|