@swc/wasm 1.3.19 → 1.3.21
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 +17 -6
- package/wasm.js +135 -86
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} query
|
|
5
|
+
* @param {any} opts
|
|
6
|
+
* @returns {any}
|
|
7
|
+
*/
|
|
8
|
+
export function browserslist(query: string, opts: any): any;
|
|
3
9
|
|
|
4
10
|
export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
|
|
5
11
|
export function minifySync(code: string, opts?: JsMinifyOptions): Output;
|
|
@@ -389,11 +395,11 @@ export interface TerserCompressOptions {
|
|
|
389
395
|
export interface TerserMangleOptions {
|
|
390
396
|
props?: TerserManglePropertiesOptions,
|
|
391
397
|
|
|
392
|
-
|
|
398
|
+
toplevel?: boolean,
|
|
393
399
|
|
|
394
|
-
|
|
400
|
+
keep_classnames?: boolean,
|
|
395
401
|
|
|
396
|
-
|
|
402
|
+
keep_fnames?: boolean,
|
|
397
403
|
|
|
398
404
|
keep_private_props?: boolean,
|
|
399
405
|
|
|
@@ -703,7 +709,7 @@ export interface JscConfig {
|
|
|
703
709
|
baseUrl?: string
|
|
704
710
|
|
|
705
711
|
paths?: {
|
|
706
|
-
[from: string]: [
|
|
712
|
+
[from: string]: string[]
|
|
707
713
|
}
|
|
708
714
|
|
|
709
715
|
minify?: JsMinifyOptions;
|
|
@@ -932,7 +938,7 @@ export interface GlobalPassOption {
|
|
|
932
938
|
envs?: string[];
|
|
933
939
|
}
|
|
934
940
|
|
|
935
|
-
export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig;
|
|
941
|
+
export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
|
|
936
942
|
|
|
937
943
|
export interface BaseModuleConfig {
|
|
938
944
|
/**
|
|
@@ -1093,6 +1099,8 @@ export interface BaseModuleConfig {
|
|
|
1093
1099
|
* If set to true, dynamic imports will be preserved.
|
|
1094
1100
|
*/
|
|
1095
1101
|
ignoreDynamic?: boolean;
|
|
1102
|
+
allowTopLevelThis?: boolean;
|
|
1103
|
+
preserveImportMeta?: boolean;
|
|
1096
1104
|
}
|
|
1097
1105
|
|
|
1098
1106
|
export interface Es6Config extends BaseModuleConfig {
|
|
@@ -1116,7 +1124,10 @@ export interface AmdConfig extends BaseModuleConfig {
|
|
|
1116
1124
|
type: "amd";
|
|
1117
1125
|
moduleId?: string;
|
|
1118
1126
|
}
|
|
1119
|
-
|
|
1127
|
+
export interface SystemjsConfig {
|
|
1128
|
+
type: "systemjs";
|
|
1129
|
+
allowTopLevelThis?: boolean;
|
|
1130
|
+
}
|
|
1120
1131
|
export interface Output {
|
|
1121
1132
|
/**
|
|
1122
1133
|
* Transformed code
|
package/wasm.js
CHANGED
|
@@ -293,13 +293,12 @@ module.exports.parse = function(s, opts) {
|
|
|
293
293
|
/**
|
|
294
294
|
* @param {any} s
|
|
295
295
|
* @param {any} opts
|
|
296
|
-
* @param {any} experimental_plugin_bytes_resolver
|
|
297
296
|
* @returns {any}
|
|
298
297
|
*/
|
|
299
|
-
module.exports.
|
|
298
|
+
module.exports.printSync = function(s, opts) {
|
|
300
299
|
try {
|
|
301
300
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
302
|
-
wasm.
|
|
301
|
+
wasm.printSync(retptr, addHeapObject(s), addHeapObject(opts));
|
|
303
302
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
304
303
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
305
304
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -315,23 +314,23 @@ module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resol
|
|
|
315
314
|
/**
|
|
316
315
|
* @param {any} s
|
|
317
316
|
* @param {any} opts
|
|
318
|
-
* @param {any} experimental_plugin_bytes_resolver
|
|
319
317
|
* @returns {Promise<any>}
|
|
320
318
|
*/
|
|
321
|
-
module.exports.
|
|
322
|
-
const ret = wasm.
|
|
319
|
+
module.exports.print = function(s, opts) {
|
|
320
|
+
const ret = wasm.print(addHeapObject(s), addHeapObject(opts));
|
|
323
321
|
return takeObject(ret);
|
|
324
322
|
};
|
|
325
323
|
|
|
326
324
|
/**
|
|
327
325
|
* @param {any} s
|
|
328
326
|
* @param {any} opts
|
|
327
|
+
* @param {any} experimental_plugin_bytes_resolver
|
|
329
328
|
* @returns {any}
|
|
330
329
|
*/
|
|
331
|
-
module.exports.
|
|
330
|
+
module.exports.transformSync = function(s, opts, experimental_plugin_bytes_resolver) {
|
|
332
331
|
try {
|
|
333
332
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
334
|
-
wasm.
|
|
333
|
+
wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
|
|
335
334
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
336
335
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
337
336
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -347,13 +346,37 @@ module.exports.printSync = function(s, opts) {
|
|
|
347
346
|
/**
|
|
348
347
|
* @param {any} s
|
|
349
348
|
* @param {any} opts
|
|
349
|
+
* @param {any} experimental_plugin_bytes_resolver
|
|
350
350
|
* @returns {Promise<any>}
|
|
351
351
|
*/
|
|
352
|
-
module.exports.
|
|
353
|
-
const ret = wasm.
|
|
352
|
+
module.exports.transform = function(s, opts, experimental_plugin_bytes_resolver) {
|
|
353
|
+
const ret = wasm.transform(addHeapObject(s), addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver));
|
|
354
354
|
return takeObject(ret);
|
|
355
355
|
};
|
|
356
356
|
|
|
357
|
+
/**
|
|
358
|
+
* @param {string} query
|
|
359
|
+
* @param {any} opts
|
|
360
|
+
* @returns {any}
|
|
361
|
+
*/
|
|
362
|
+
module.exports.browserslist = function(query, opts) {
|
|
363
|
+
try {
|
|
364
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
365
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
wasm.browserslist(retptr, ptr0, len0, addHeapObject(opts));
|
|
368
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
369
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
370
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
371
|
+
if (r2) {
|
|
372
|
+
throw takeObject(r1);
|
|
373
|
+
}
|
|
374
|
+
return takeObject(r0);
|
|
375
|
+
} finally {
|
|
376
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
|
|
357
380
|
function getCachedStringFromWasm0(ptr, len) {
|
|
358
381
|
if (ptr === 0) {
|
|
359
382
|
return getObject(len);
|
|
@@ -369,7 +392,7 @@ function handleError(f, args) {
|
|
|
369
392
|
wasm.__wbindgen_export_5(addHeapObject(e));
|
|
370
393
|
}
|
|
371
394
|
}
|
|
372
|
-
function
|
|
395
|
+
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
373
396
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
374
397
|
}
|
|
375
398
|
|
|
@@ -405,11 +428,6 @@ module.exports.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
|
|
|
405
428
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
406
429
|
};
|
|
407
430
|
|
|
408
|
-
module.exports.__wbg_new_268f7b7dd3430798 = function() {
|
|
409
|
-
const ret = new Map();
|
|
410
|
-
return addHeapObject(ret);
|
|
411
|
-
};
|
|
412
|
-
|
|
413
431
|
module.exports.__wbg_set_933729cf5b66ac11 = function(arg0, arg1, arg2) {
|
|
414
432
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
415
433
|
return addHeapObject(ret);
|
|
@@ -425,14 +443,9 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
|
425
443
|
return addHeapObject(ret);
|
|
426
444
|
};
|
|
427
445
|
|
|
428
|
-
module.exports.
|
|
429
|
-
const ret =
|
|
430
|
-
return ret;
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
434
|
-
const ret = getObject(arg0) === undefined;
|
|
435
|
-
return ret;
|
|
446
|
+
module.exports.__wbg_new_268f7b7dd3430798 = function() {
|
|
447
|
+
const ret = new Map();
|
|
448
|
+
return addHeapObject(ret);
|
|
436
449
|
};
|
|
437
450
|
|
|
438
451
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
@@ -444,48 +457,8 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
444
457
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
445
458
|
};
|
|
446
459
|
|
|
447
|
-
module.exports.
|
|
448
|
-
|
|
449
|
-
var state0 = {a: arg0, b: arg1};
|
|
450
|
-
var cb0 = (arg0, arg1) => {
|
|
451
|
-
const a = state0.a;
|
|
452
|
-
state0.a = 0;
|
|
453
|
-
try {
|
|
454
|
-
return __wbg_adapter_107(a, state0.b, arg0, arg1);
|
|
455
|
-
} finally {
|
|
456
|
-
state0.a = a;
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
const ret = new Promise(cb0);
|
|
460
|
-
return addHeapObject(ret);
|
|
461
|
-
} finally {
|
|
462
|
-
state0.a = state0.b = 0;
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
module.exports.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
|
|
467
|
-
const ret = getObject(arg0).next();
|
|
468
|
-
return addHeapObject(ret);
|
|
469
|
-
}, arguments) };
|
|
470
|
-
|
|
471
|
-
module.exports.__wbg_done_1b73b0672e15f234 = function(arg0) {
|
|
472
|
-
const ret = getObject(arg0).done;
|
|
473
|
-
return ret;
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
module.exports.__wbg_value_1ccc36bc03462d71 = function(arg0) {
|
|
477
|
-
const ret = getObject(arg0).value;
|
|
478
|
-
return addHeapObject(ret);
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
module.exports.__wbg_get_57245cc7d7c7619d = function(arg0, arg1) {
|
|
482
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
483
|
-
return addHeapObject(ret);
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
487
|
-
const v = getObject(arg0);
|
|
488
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
460
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
461
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
489
462
|
return ret;
|
|
490
463
|
};
|
|
491
464
|
|
|
@@ -505,9 +478,9 @@ module.exports.__wbg_length_6e3bbe7c8bd4dbd8 = function(arg0) {
|
|
|
505
478
|
return ret;
|
|
506
479
|
};
|
|
507
480
|
|
|
508
|
-
module.exports.
|
|
509
|
-
const ret = getObject(arg0)
|
|
510
|
-
return ret;
|
|
481
|
+
module.exports.__wbg_get_57245cc7d7c7619d = function(arg0, arg1) {
|
|
482
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
483
|
+
return addHeapObject(ret);
|
|
511
484
|
};
|
|
512
485
|
|
|
513
486
|
module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
|
|
@@ -515,11 +488,22 @@ module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
|
|
|
515
488
|
return addHeapObject(ret);
|
|
516
489
|
};
|
|
517
490
|
|
|
491
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
492
|
+
const ret = getObject(arg0) === undefined;
|
|
493
|
+
return ret;
|
|
494
|
+
};
|
|
495
|
+
|
|
518
496
|
module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
519
497
|
const ret = getObject(arg0) in getObject(arg1);
|
|
520
498
|
return ret;
|
|
521
499
|
};
|
|
522
500
|
|
|
501
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
502
|
+
const v = getObject(arg0);
|
|
503
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
504
|
+
return ret;
|
|
505
|
+
};
|
|
506
|
+
|
|
523
507
|
module.exports.__wbindgen_is_bigint = function(arg0) {
|
|
524
508
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
525
509
|
return ret;
|
|
@@ -574,6 +558,45 @@ module.exports.__wbg_call_168da88779e35f61 = function() { return handleError(fun
|
|
|
574
558
|
return addHeapObject(ret);
|
|
575
559
|
}, arguments) };
|
|
576
560
|
|
|
561
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
562
|
+
const ret = getObject(arg0) === null;
|
|
563
|
+
return ret;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
module.exports.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
|
|
567
|
+
const ret = getObject(arg0).next();
|
|
568
|
+
return addHeapObject(ret);
|
|
569
|
+
}, arguments) };
|
|
570
|
+
|
|
571
|
+
module.exports.__wbg_done_1b73b0672e15f234 = function(arg0) {
|
|
572
|
+
const ret = getObject(arg0).done;
|
|
573
|
+
return ret;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
module.exports.__wbg_value_1ccc36bc03462d71 = function(arg0) {
|
|
577
|
+
const ret = getObject(arg0).value;
|
|
578
|
+
return addHeapObject(ret);
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
module.exports.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
|
|
582
|
+
try {
|
|
583
|
+
var state0 = {a: arg0, b: arg1};
|
|
584
|
+
var cb0 = (arg0, arg1) => {
|
|
585
|
+
const a = state0.a;
|
|
586
|
+
state0.a = 0;
|
|
587
|
+
try {
|
|
588
|
+
return __wbg_adapter_110(a, state0.b, arg0, arg1);
|
|
589
|
+
} finally {
|
|
590
|
+
state0.a = a;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
const ret = new Promise(cb0);
|
|
594
|
+
return addHeapObject(ret);
|
|
595
|
+
} finally {
|
|
596
|
+
state0.a = state0.b = 0;
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
|
|
577
600
|
module.exports.__wbg_new0_a57059d72c5b7aee = function() {
|
|
578
601
|
const ret = new Date();
|
|
579
602
|
return addHeapObject(ret);
|
|
@@ -584,6 +607,47 @@ module.exports.__wbg_getTimezoneOffset_89bd4275e1ca8341 = function(arg0) {
|
|
|
584
607
|
return ret;
|
|
585
608
|
};
|
|
586
609
|
|
|
610
|
+
module.exports.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
|
|
611
|
+
const ret = self.self;
|
|
612
|
+
return addHeapObject(ret);
|
|
613
|
+
}, arguments) };
|
|
614
|
+
|
|
615
|
+
module.exports.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
|
|
616
|
+
const ret = window.window;
|
|
617
|
+
return addHeapObject(ret);
|
|
618
|
+
}, arguments) };
|
|
619
|
+
|
|
620
|
+
module.exports.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
|
|
621
|
+
const ret = globalThis.globalThis;
|
|
622
|
+
return addHeapObject(ret);
|
|
623
|
+
}, arguments) };
|
|
624
|
+
|
|
625
|
+
module.exports.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
|
|
626
|
+
const ret = global.global;
|
|
627
|
+
return addHeapObject(ret);
|
|
628
|
+
}, arguments) };
|
|
629
|
+
|
|
630
|
+
module.exports.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
|
|
631
|
+
var v0 = getCachedStringFromWasm0(arg0, arg1);
|
|
632
|
+
const ret = new Function(v0);
|
|
633
|
+
return addHeapObject(ret);
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
module.exports.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
|
|
637
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
638
|
+
return addHeapObject(ret);
|
|
639
|
+
}, arguments) };
|
|
640
|
+
|
|
641
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
642
|
+
const ret = getObject(arg0);
|
|
643
|
+
return addHeapObject(ret);
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
module.exports.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
|
|
647
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
648
|
+
return addHeapObject(ret);
|
|
649
|
+
}, arguments) };
|
|
650
|
+
|
|
587
651
|
module.exports.__wbg_getTime_cb82adb2556ed13e = function(arg0) {
|
|
588
652
|
const ret = getObject(arg0).getTime();
|
|
589
653
|
return ret;
|
|
@@ -608,21 +672,11 @@ if (arg0 !== 0) { wasm.__wbindgen_export_4(arg0, arg1); }
|
|
|
608
672
|
console.error(v0);
|
|
609
673
|
};
|
|
610
674
|
|
|
611
|
-
module.exports.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
|
|
612
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
613
|
-
return addHeapObject(ret);
|
|
614
|
-
}, arguments) };
|
|
615
|
-
|
|
616
675
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
617
676
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
618
677
|
return ret;
|
|
619
678
|
};
|
|
620
679
|
|
|
621
|
-
module.exports.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
|
|
622
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
623
|
-
return addHeapObject(ret);
|
|
624
|
-
}, arguments) };
|
|
625
|
-
|
|
626
680
|
module.exports.__wbg_next_579e583d33566a86 = function(arg0) {
|
|
627
681
|
const ret = getObject(arg0).next;
|
|
628
682
|
return addHeapObject(ret);
|
|
@@ -682,11 +736,6 @@ module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
|
|
|
682
736
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
683
737
|
};
|
|
684
738
|
|
|
685
|
-
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
686
|
-
const ret = getObject(arg0);
|
|
687
|
-
return addHeapObject(ret);
|
|
688
|
-
};
|
|
689
|
-
|
|
690
739
|
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
691
740
|
const ret = debugString(getObject(arg1));
|
|
692
741
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -719,8 +768,8 @@ module.exports.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
|
|
|
719
768
|
return addHeapObject(ret);
|
|
720
769
|
};
|
|
721
770
|
|
|
722
|
-
module.exports.
|
|
723
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
771
|
+
module.exports.__wbindgen_closure_wrapper18977 = function(arg0, arg1, arg2) {
|
|
772
|
+
const ret = makeMutClosure(arg0, arg1, 228, __wbg_adapter_50);
|
|
724
773
|
return addHeapObject(ret);
|
|
725
774
|
};
|
|
726
775
|
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|