@next/swc-wasm-nodejs 13.4.20-canary.34 → 13.4.20-canary.36

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.
Files changed (4) hide show
  1. package/package.json +1 -1
  2. package/wasm.d.ts +12 -12
  3. package/wasm.js +122 -112
  4. package/wasm_bg.wasm +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-nodejs",
3
- "version": "13.4.20-canary.34",
3
+ "version": "13.4.20-canary.36",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -7,6 +7,18 @@
7
7
  */
8
8
  export function browserslist(query: string, opts: any): any;
9
9
  /**
10
+ * @param {string} value
11
+ * @param {any} opts
12
+ * @returns {any}
13
+ */
14
+ export function mdxCompileSync(value: string, opts: any): any;
15
+ /**
16
+ * @param {string} value
17
+ * @param {any} opts
18
+ * @returns {Promise<any>}
19
+ */
20
+ export function mdxCompile(value: string, opts: any): Promise<any>;
21
+ /**
10
22
  * @param {string} s
11
23
  * @param {any} opts
12
24
  * @returns {any}
@@ -42,15 +54,3 @@ export function parseSync(s: string, opts: any): any;
42
54
  * @returns {Promise<any>}
43
55
  */
44
56
  export function parse(s: string, opts: any): Promise<any>;
45
- /**
46
- * @param {string} value
47
- * @param {any} opts
48
- * @returns {any}
49
- */
50
- export function mdxCompileSync(value: string, opts: any): any;
51
- /**
52
- * @param {string} value
53
- * @param {any} opts
54
- * @returns {Promise<any>}
55
- */
56
- export function mdxCompile(value: string, opts: any): Promise<any>;
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 { TextEncoder, TextDecoder } = require(`util`);
4
+ const { TextDecoder, TextEncoder } = require(`util`);
5
5
 
6
6
  const heap = new Array(128).fill(undefined);
7
7
 
@@ -23,7 +23,9 @@ function takeObject(idx) {
23
23
  return ret;
24
24
  }
25
25
 
26
- let WASM_VECTOR_LEN = 0;
26
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
27
+
28
+ cachedTextDecoder.decode();
27
29
 
28
30
  let cachedUint8Memory0 = null;
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'
@@ -100,23 +117,6 @@ function getInt32Memory0() {
100
117
  return cachedInt32Memory0;
101
118
  }
102
119
 
103
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
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;
118
- }
119
-
120
120
  function debugString(val) {
121
121
  // primitive types
122
122
  const type = typeof val;
@@ -224,8 +224,8 @@ function makeMutClosure(arg0, arg1, dtor, f) {
224
224
 
225
225
  return real;
226
226
  }
227
- function __wbg_adapter_46(arg0, arg1, arg2) {
228
- wasm.wasm_bindgen_4c38edf88c933193___convert__closures__invoke1_mut___wasm_bindgen_4c38edf88c933193___JsValue_____(arg0, arg1, addHeapObject(arg2));
227
+ function __wbg_adapter_48(arg0, arg1, arg2) {
228
+ wasm.wasm_bindgen_73cd18f45dc52fc7___convert__closures__invoke1_mut___wasm_bindgen_73cd18f45dc52fc7___JsValue_____(arg0, arg1, addHeapObject(arg2));
229
229
  }
230
230
 
231
231
  /**
@@ -266,19 +266,19 @@ function handleError(f, args) {
266
266
  wasm.__wbindgen_exn_store(addHeapObject(e));
267
267
  }
268
268
  }
269
- function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
270
- wasm.wasm_bindgen_4c38edf88c933193___convert__closures__invoke2_mut___wasm_bindgen_4c38edf88c933193___JsValue__wasm_bindgen_4c38edf88c933193___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
269
+ function __wbg_adapter_114(arg0, arg1, arg2, arg3) {
270
+ wasm.wasm_bindgen_73cd18f45dc52fc7___convert__closures__invoke2_mut___wasm_bindgen_73cd18f45dc52fc7___JsValue__wasm_bindgen_73cd18f45dc52fc7___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
271
271
  }
272
272
 
273
273
  /**
274
- * @param {string} s
274
+ * @param {string} value
275
275
  * @param {any} opts
276
276
  * @returns {any}
277
277
  */
278
- module.exports.minifySync = function(s, opts) {
278
+ module.exports.mdxCompileSync = function(value, opts) {
279
279
  try {
280
280
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
281
- wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
281
+ wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
282
282
  var r0 = getInt32Memory0()[retptr / 4 + 0];
283
283
  var r1 = getInt32Memory0()[retptr / 4 + 1];
284
284
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -292,24 +292,24 @@ module.exports.minifySync = function(s, opts) {
292
292
  };
293
293
 
294
294
  /**
295
- * @param {string} s
295
+ * @param {string} value
296
296
  * @param {any} opts
297
297
  * @returns {Promise<any>}
298
298
  */
299
- module.exports.minify = function(s, opts) {
300
- const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
299
+ module.exports.mdxCompile = function(value, opts) {
300
+ const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
301
301
  return takeObject(ret);
302
302
  };
303
303
 
304
304
  /**
305
- * @param {any} s
305
+ * @param {string} s
306
306
  * @param {any} opts
307
307
  * @returns {any}
308
308
  */
309
- module.exports.transformSync = function(s, opts) {
309
+ module.exports.minifySync = function(s, opts) {
310
310
  try {
311
311
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
312
- wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
312
+ wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
313
313
  var r0 = getInt32Memory0()[retptr / 4 + 0];
314
314
  var r1 = getInt32Memory0()[retptr / 4 + 1];
315
315
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -323,24 +323,24 @@ module.exports.transformSync = function(s, opts) {
323
323
  };
324
324
 
325
325
  /**
326
- * @param {any} s
326
+ * @param {string} s
327
327
  * @param {any} opts
328
328
  * @returns {Promise<any>}
329
329
  */
330
- module.exports.transform = function(s, opts) {
331
- const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
330
+ module.exports.minify = function(s, opts) {
331
+ const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
332
332
  return takeObject(ret);
333
333
  };
334
334
 
335
335
  /**
336
- * @param {string} s
336
+ * @param {any} s
337
337
  * @param {any} opts
338
338
  * @returns {any}
339
339
  */
340
- module.exports.parseSync = function(s, opts) {
340
+ module.exports.transformSync = function(s, opts) {
341
341
  try {
342
342
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
343
- wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
343
+ wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
344
344
  var r0 = getInt32Memory0()[retptr / 4 + 0];
345
345
  var r1 = getInt32Memory0()[retptr / 4 + 1];
346
346
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -354,24 +354,24 @@ module.exports.parseSync = function(s, opts) {
354
354
  };
355
355
 
356
356
  /**
357
- * @param {string} s
357
+ * @param {any} s
358
358
  * @param {any} opts
359
359
  * @returns {Promise<any>}
360
360
  */
361
- module.exports.parse = function(s, opts) {
362
- const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
361
+ module.exports.transform = function(s, opts) {
362
+ const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
363
363
  return takeObject(ret);
364
364
  };
365
365
 
366
366
  /**
367
- * @param {string} value
367
+ * @param {string} s
368
368
  * @param {any} opts
369
369
  * @returns {any}
370
370
  */
371
- module.exports.mdxCompileSync = function(value, opts) {
371
+ module.exports.parseSync = function(s, opts) {
372
372
  try {
373
373
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
374
- wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
374
+ wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
375
375
  var r0 = getInt32Memory0()[retptr / 4 + 0];
376
376
  var r1 = getInt32Memory0()[retptr / 4 + 1];
377
377
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -385,12 +385,12 @@ module.exports.mdxCompileSync = function(value, opts) {
385
385
  };
386
386
 
387
387
  /**
388
- * @param {string} value
388
+ * @param {string} s
389
389
  * @param {any} opts
390
390
  * @returns {Promise<any>}
391
391
  */
392
- module.exports.mdxCompile = function(value, opts) {
393
- const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
392
+ module.exports.parse = function(s, opts) {
393
+ const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
394
394
  return takeObject(ret);
395
395
  };
396
396
 
@@ -418,25 +418,20 @@ module.exports.__wbg_value_6ac8da5cc5b3efda = function(arg0) {
418
418
  return addHeapObject(ret);
419
419
  };
420
420
 
421
- module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
422
- const ret = getObject(arg0)[getObject(arg1)];
421
+ module.exports.__wbg_new0_25059e40b1c02766 = function() {
422
+ const ret = new Date();
423
423
  return addHeapObject(ret);
424
424
  };
425
425
 
426
- module.exports.__wbindgen_is_undefined = function(arg0) {
427
- const ret = getObject(arg0) === undefined;
428
- return ret;
429
- };
430
-
431
- module.exports.__wbindgen_in = function(arg0, arg1) {
432
- const ret = getObject(arg0) in getObject(arg1);
433
- return ret;
426
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
427
+ const ret = getStringFromWasm0(arg0, arg1);
428
+ return addHeapObject(ret);
434
429
  };
435
430
 
436
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
437
- const ret = getObject(arg0) == getObject(arg1);
438
- return ret;
439
- };
431
+ module.exports.__wbg_get_baf4855f9a986186 = function() { return handleError(function (arg0, arg1) {
432
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
433
+ return addHeapObject(ret);
434
+ }, arguments) };
440
435
 
441
436
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
442
437
  const obj = getObject(arg1);
@@ -447,8 +442,13 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
447
442
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
448
443
  };
449
444
 
450
- module.exports.__wbg_new0_25059e40b1c02766 = function() {
451
- const ret = new Date();
445
+ module.exports.__wbindgen_number_new = function(arg0) {
446
+ const ret = arg0;
447
+ return addHeapObject(ret);
448
+ };
449
+
450
+ module.exports.__wbg_new_f127e324c1313064 = function(arg0) {
451
+ const ret = new Date(getObject(arg0));
452
452
  return addHeapObject(ret);
453
453
  };
454
454
 
@@ -457,16 +457,11 @@ module.exports.__wbg_getTimezoneOffset_2a6b27fb18493a56 = function(arg0) {
457
457
  return ret;
458
458
  };
459
459
 
460
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
461
- const ret = getStringFromWasm0(arg0, arg1);
462
- return addHeapObject(ret);
460
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
461
+ const ret = getObject(arg0) == getObject(arg1);
462
+ return ret;
463
463
  };
464
464
 
465
- module.exports.__wbg_get_baf4855f9a986186 = function() { return handleError(function (arg0, arg1) {
466
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
467
- return addHeapObject(ret);
468
- }, arguments) };
469
-
470
465
  module.exports.__wbindgen_is_object = function(arg0) {
471
466
  const val = getObject(arg0);
472
467
  const ret = typeof(val) === 'object' && val !== null;
@@ -488,6 +483,21 @@ module.exports.__wbg_set_17224bc548dd1d7b = function(arg0, arg1, arg2) {
488
483
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
489
484
  };
490
485
 
486
+ module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
487
+ const ret = getObject(arg0)[getObject(arg1)];
488
+ return addHeapObject(ret);
489
+ };
490
+
491
+ module.exports.__wbindgen_is_undefined = function(arg0) {
492
+ const ret = getObject(arg0) === undefined;
493
+ return ret;
494
+ };
495
+
496
+ module.exports.__wbindgen_in = function(arg0, arg1) {
497
+ const ret = getObject(arg0) in getObject(arg1);
498
+ return ret;
499
+ };
500
+
491
501
  module.exports.__wbg_getTime_7c59072d1651a3cf = function(arg0) {
492
502
  const ret = getObject(arg0).getTime();
493
503
  return ret;
@@ -527,7 +537,7 @@ module.exports.__wbg_newwithbyteoffsetandlength_9fb2f11355ecadf5 = function(arg0
527
537
  return addHeapObject(ret);
528
538
  };
529
539
 
530
- module.exports.__wbg_randomFillSync_e950366c42764a07 = function() { return handleError(function (arg0, arg1) {
540
+ module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
531
541
  getObject(arg0).randomFillSync(takeObject(arg1));
532
542
  }, arguments) };
533
543
 
@@ -536,7 +546,7 @@ module.exports.__wbg_subarray_7526649b91a252a6 = function(arg0, arg1, arg2) {
536
546
  return addHeapObject(ret);
537
547
  };
538
548
 
539
- module.exports.__wbg_getRandomValues_3774744e221a22ad = function() { return handleError(function (arg0, arg1) {
549
+ module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
540
550
  getObject(arg0).getRandomValues(getObject(arg1));
541
551
  }, arguments) };
542
552
 
@@ -549,22 +559,22 @@ module.exports.__wbg_set_17499e8aa4003ebd = function(arg0, arg1, arg2) {
549
559
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
550
560
  };
551
561
 
552
- module.exports.__wbg_crypto_70a96de3b6b73dac = function(arg0) {
562
+ module.exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
553
563
  const ret = getObject(arg0).crypto;
554
564
  return addHeapObject(ret);
555
565
  };
556
566
 
557
- module.exports.__wbg_process_dd1577445152112e = function(arg0) {
567
+ module.exports.__wbg_process_298734cf255a885d = function(arg0) {
558
568
  const ret = getObject(arg0).process;
559
569
  return addHeapObject(ret);
560
570
  };
561
571
 
562
- module.exports.__wbg_versions_58036bec3add9e6f = function(arg0) {
572
+ module.exports.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {
563
573
  const ret = getObject(arg0).versions;
564
574
  return addHeapObject(ret);
565
575
  };
566
576
 
567
- module.exports.__wbg_node_6a9d28205ed5b0d8 = function(arg0) {
577
+ module.exports.__wbg_node_1cd7a5d853dbea79 = function(arg0) {
568
578
  const ret = getObject(arg0).node;
569
579
  return addHeapObject(ret);
570
580
  };
@@ -574,7 +584,7 @@ module.exports.__wbindgen_is_string = function(arg0) {
574
584
  return ret;
575
585
  };
576
586
 
577
- module.exports.__wbg_msCrypto_adbc770ec9eca9c7 = function(arg0) {
587
+ module.exports.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {
578
588
  const ret = getObject(arg0).msCrypto;
579
589
  return addHeapObject(ret);
580
590
  };
@@ -584,7 +594,7 @@ module.exports.__wbg_newwithlength_b56c882b57805732 = function(arg0) {
584
594
  return addHeapObject(ret);
585
595
  };
586
596
 
587
- module.exports.__wbg_require_f05d779769764e82 = function() { return handleError(function () {
597
+ module.exports.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () {
588
598
  const ret = module.require;
589
599
  return addHeapObject(ret);
590
600
  }, arguments) };
@@ -697,32 +707,9 @@ module.exports.__wbg_instanceof_ArrayBuffer_a69f02ee4c4f5065 = function(arg0) {
697
707
  return ret;
698
708
  };
699
709
 
700
- module.exports.__wbg_new_f9876326328f45ed = function() {
701
- const ret = new Object();
702
- return addHeapObject(ret);
703
- };
704
-
705
- module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
706
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
707
- };
708
-
709
- module.exports.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
710
- try {
711
- var state0 = {a: arg0, b: arg1};
712
- var cb0 = (arg0, arg1) => {
713
- const a = state0.a;
714
- state0.a = 0;
715
- try {
716
- return __wbg_adapter_110(a, state0.b, arg0, arg1);
717
- } finally {
718
- state0.a = a;
719
- }
720
- };
721
- const ret = new Promise(cb0);
722
- return addHeapObject(ret);
723
- } finally {
724
- state0.a = state0.b = 0;
725
- }
710
+ module.exports.__wbg_isArray_39d28997bf6b96b4 = function(arg0) {
711
+ const ret = Array.isArray(getObject(arg0));
712
+ return ret;
726
713
  };
727
714
 
728
715
  module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
@@ -730,11 +717,6 @@ module.exports.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
730
717
  return ret;
731
718
  };
732
719
 
733
- module.exports.__wbg_isArray_39d28997bf6b96b4 = function(arg0) {
734
- const ret = Array.isArray(getObject(arg0));
735
- return ret;
736
- };
737
-
738
720
  module.exports.__wbindgen_is_bigint = function(arg0) {
739
721
  const ret = typeof(getObject(arg0)) === 'bigint';
740
722
  return ret;
@@ -767,6 +749,34 @@ module.exports.__wbg_isSafeInteger_8c4789029e885159 = function(arg0) {
767
749
  return ret;
768
750
  };
769
751
 
752
+ module.exports.__wbg_new_f9876326328f45ed = function() {
753
+ const ret = new Object();
754
+ return addHeapObject(ret);
755
+ };
756
+
757
+ module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
758
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
759
+ };
760
+
761
+ module.exports.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
762
+ try {
763
+ var state0 = {a: arg0, b: arg1};
764
+ var cb0 = (arg0, arg1) => {
765
+ const a = state0.a;
766
+ state0.a = 0;
767
+ try {
768
+ return __wbg_adapter_114(a, state0.b, arg0, arg1);
769
+ } finally {
770
+ state0.a = a;
771
+ }
772
+ };
773
+ const ret = new Promise(cb0);
774
+ return addHeapObject(ret);
775
+ } finally {
776
+ state0.a = state0.b = 0;
777
+ }
778
+ };
779
+
770
780
  module.exports.__wbindgen_throw = function(arg0, arg1) {
771
781
  throw new Error(getStringFromWasm0(arg0, arg1));
772
782
  };
@@ -791,8 +801,8 @@ module.exports.__wbg_then_ec5db6d509eb475f = function(arg0, arg1) {
791
801
  return addHeapObject(ret);
792
802
  };
793
803
 
794
- module.exports.__wbindgen_closure_wrapper22099 = function(arg0, arg1, arg2) {
795
- const ret = makeMutClosure(arg0, arg1, 287, __wbg_adapter_46);
804
+ module.exports.__wbindgen_closure_wrapper22060 = function(arg0, arg1, arg2) {
805
+ const ret = makeMutClosure(arg0, arg1, 283, __wbg_adapter_48);
796
806
  return addHeapObject(ret);
797
807
  };
798
808
 
package/wasm_bg.wasm CHANGED
Binary file