@next/swc-wasm-web 13.4.17 → 13.4.18

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "version": "13.4.17",
3
+ "version": "13.4.18",
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,40 +54,28 @@ 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>;
57
57
 
58
58
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
59
59
 
60
60
  export interface InitOutput {
61
61
  readonly memory: WebAssembly.Memory;
62
62
  readonly browserslist: (a: number, b: number, c: number, d: number) => void;
63
+ readonly mdxCompileSync: (a: number, b: number, c: number) => void;
64
+ readonly mdxCompile: (a: number, b: number) => number;
63
65
  readonly minifySync: (a: number, b: number, c: number) => void;
64
66
  readonly minify: (a: number, b: number) => number;
65
67
  readonly transformSync: (a: number, b: number, c: number) => void;
66
68
  readonly transform: (a: number, b: number) => number;
67
69
  readonly parseSync: (a: number, b: number, c: number) => void;
68
70
  readonly parse: (a: number, b: number) => number;
69
- readonly mdxCompileSync: (a: number, b: number, c: number) => void;
70
- readonly mdxCompile: (a: number, b: number) => number;
71
71
  readonly __wbindgen_malloc: (a: number) => number;
72
72
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
73
73
  readonly __wbindgen_export_2: WebAssembly.Table;
74
- readonly wasm_bindgen_e32e3400d457f302___convert__closures__invoke1_mut___wasm_bindgen_e32e3400d457f302___JsValue_____: (a: number, b: number, c: number) => void;
74
+ readonly wasm_bindgen_406eacf6a554cda5___convert__closures__invoke1_mut___wasm_bindgen_406eacf6a554cda5___JsValue_____: (a: number, b: number, c: number) => void;
75
75
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
76
76
  readonly __wbindgen_free: (a: number, b: number) => void;
77
77
  readonly __wbindgen_exn_store: (a: number) => void;
78
- readonly wasm_bindgen_e32e3400d457f302___convert__closures__invoke2_mut___wasm_bindgen_e32e3400d457f302___JsValue__wasm_bindgen_e32e3400d457f302___JsValue_____: (a: number, b: number, c: number, d: number) => void;
78
+ readonly wasm_bindgen_406eacf6a554cda5___convert__closures__invoke2_mut___wasm_bindgen_406eacf6a554cda5___JsValue__wasm_bindgen_406eacf6a554cda5___JsValue_____: (a: number, b: number, c: number, d: number) => void;
79
79
  }
80
80
 
81
81
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/wasm.js CHANGED
@@ -20,9 +20,7 @@ function takeObject(idx) {
20
20
  return ret;
21
21
  }
22
22
 
23
- const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
24
-
25
- cachedTextDecoder.decode();
23
+ let WASM_VECTOR_LEN = 0;
26
24
 
27
25
  let cachedUint8Memory0 = null;
28
26
 
@@ -33,21 +31,6 @@ function getUint8Memory0() {
33
31
  return cachedUint8Memory0;
34
32
  }
35
33
 
36
- function getStringFromWasm0(ptr, len) {
37
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
38
- }
39
-
40
- function addHeapObject(obj) {
41
- if (heap_next === heap.length) heap.push(heap.length + 1);
42
- const idx = heap_next;
43
- heap_next = heap[idx];
44
-
45
- heap[idx] = obj;
46
- return idx;
47
- }
48
-
49
- let WASM_VECTOR_LEN = 0;
50
-
51
34
  const cachedTextEncoder = new TextEncoder('utf-8');
52
35
 
53
36
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -114,6 +97,23 @@ function getInt32Memory0() {
114
97
  return cachedInt32Memory0;
115
98
  }
116
99
 
100
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
101
+
102
+ cachedTextDecoder.decode();
103
+
104
+ function getStringFromWasm0(ptr, len) {
105
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
106
+ }
107
+
108
+ function addHeapObject(obj) {
109
+ if (heap_next === heap.length) heap.push(heap.length + 1);
110
+ const idx = heap_next;
111
+ heap_next = heap[idx];
112
+
113
+ heap[idx] = obj;
114
+ return idx;
115
+ }
116
+
117
117
  function debugString(val) {
118
118
  // primitive types
119
119
  const type = typeof val;
@@ -222,7 +222,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
222
222
  return real;
223
223
  }
224
224
  function __wbg_adapter_46(arg0, arg1, arg2) {
225
- wasm.wasm_bindgen_e32e3400d457f302___convert__closures__invoke1_mut___wasm_bindgen_e32e3400d457f302___JsValue_____(arg0, arg1, addHeapObject(arg2));
225
+ wasm.wasm_bindgen_406eacf6a554cda5___convert__closures__invoke1_mut___wasm_bindgen_406eacf6a554cda5___JsValue_____(arg0, arg1, addHeapObject(arg2));
226
226
  }
227
227
 
228
228
  /**
@@ -264,18 +264,18 @@ function handleError(f, args) {
264
264
  }
265
265
  }
266
266
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
267
- wasm.wasm_bindgen_e32e3400d457f302___convert__closures__invoke2_mut___wasm_bindgen_e32e3400d457f302___JsValue__wasm_bindgen_e32e3400d457f302___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
267
+ wasm.wasm_bindgen_406eacf6a554cda5___convert__closures__invoke2_mut___wasm_bindgen_406eacf6a554cda5___JsValue__wasm_bindgen_406eacf6a554cda5___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
268
268
  }
269
269
 
270
270
  /**
271
- * @param {string} s
271
+ * @param {string} value
272
272
  * @param {any} opts
273
273
  * @returns {any}
274
274
  */
275
- export function minifySync(s, opts) {
275
+ export function mdxCompileSync(value, opts) {
276
276
  try {
277
277
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
278
- wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
278
+ wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
279
279
  var r0 = getInt32Memory0()[retptr / 4 + 0];
280
280
  var r1 = getInt32Memory0()[retptr / 4 + 1];
281
281
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -289,24 +289,24 @@ export function minifySync(s, opts) {
289
289
  }
290
290
 
291
291
  /**
292
- * @param {string} s
292
+ * @param {string} value
293
293
  * @param {any} opts
294
294
  * @returns {Promise<any>}
295
295
  */
296
- export function minify(s, opts) {
297
- const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
296
+ export function mdxCompile(value, opts) {
297
+ const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
298
298
  return takeObject(ret);
299
299
  }
300
300
 
301
301
  /**
302
- * @param {any} s
302
+ * @param {string} s
303
303
  * @param {any} opts
304
304
  * @returns {any}
305
305
  */
306
- export function transformSync(s, opts) {
306
+ export function minifySync(s, opts) {
307
307
  try {
308
308
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
309
- wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
309
+ wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
310
310
  var r0 = getInt32Memory0()[retptr / 4 + 0];
311
311
  var r1 = getInt32Memory0()[retptr / 4 + 1];
312
312
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -320,24 +320,24 @@ export function transformSync(s, opts) {
320
320
  }
321
321
 
322
322
  /**
323
- * @param {any} s
323
+ * @param {string} s
324
324
  * @param {any} opts
325
325
  * @returns {Promise<any>}
326
326
  */
327
- export function transform(s, opts) {
328
- const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
327
+ export function minify(s, opts) {
328
+ const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
329
329
  return takeObject(ret);
330
330
  }
331
331
 
332
332
  /**
333
- * @param {string} s
333
+ * @param {any} s
334
334
  * @param {any} opts
335
335
  * @returns {any}
336
336
  */
337
- export function parseSync(s, opts) {
337
+ export function transformSync(s, opts) {
338
338
  try {
339
339
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
340
- wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
340
+ wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
341
341
  var r0 = getInt32Memory0()[retptr / 4 + 0];
342
342
  var r1 = getInt32Memory0()[retptr / 4 + 1];
343
343
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -351,24 +351,24 @@ export function parseSync(s, opts) {
351
351
  }
352
352
 
353
353
  /**
354
- * @param {string} s
354
+ * @param {any} s
355
355
  * @param {any} opts
356
356
  * @returns {Promise<any>}
357
357
  */
358
- export function parse(s, opts) {
359
- const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
358
+ export function transform(s, opts) {
359
+ const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
360
360
  return takeObject(ret);
361
361
  }
362
362
 
363
363
  /**
364
- * @param {string} value
364
+ * @param {string} s
365
365
  * @param {any} opts
366
366
  * @returns {any}
367
367
  */
368
- export function mdxCompileSync(value, opts) {
368
+ export function parseSync(s, opts) {
369
369
  try {
370
370
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
371
- wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
371
+ wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
372
372
  var r0 = getInt32Memory0()[retptr / 4 + 0];
373
373
  var r1 = getInt32Memory0()[retptr / 4 + 1];
374
374
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -382,12 +382,12 @@ export function mdxCompileSync(value, opts) {
382
382
  }
383
383
 
384
384
  /**
385
- * @param {string} value
385
+ * @param {string} s
386
386
  * @param {any} opts
387
387
  * @returns {Promise<any>}
388
388
  */
389
- export function mdxCompile(value, opts) {
390
- const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
389
+ export function parse(s, opts) {
390
+ const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
391
391
  return takeObject(ret);
392
392
  }
393
393
 
@@ -444,39 +444,22 @@ function getImports() {
444
444
  const ret = getObject(arg0).value;
445
445
  return addHeapObject(ret);
446
446
  };
447
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
448
- const ret = getObject(arg0) == getObject(arg1);
449
- return ret;
447
+ imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
448
+ const ret = getObject(arg0)[getObject(arg1)];
449
+ return addHeapObject(ret);
450
450
  };
451
- imports.wbg.__wbindgen_is_object = function(arg0) {
452
- const val = getObject(arg0);
453
- const ret = typeof(val) === 'object' && val !== null;
451
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
452
+ const ret = getObject(arg0) === undefined;
454
453
  return ret;
455
454
  };
456
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
457
- const v = getObject(arg0);
458
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
455
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
456
+ const ret = getObject(arg0) in getObject(arg1);
459
457
  return ret;
460
458
  };
461
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
462
- const ret = getStringFromWasm0(arg0, arg1);
463
- return addHeapObject(ret);
464
- };
465
- imports.wbg.__wbg_new_b525de17f44a8943 = function() {
466
- const ret = new Array();
467
- return addHeapObject(ret);
468
- };
469
- imports.wbg.__wbg_set_17224bc548dd1d7b = function(arg0, arg1, arg2) {
470
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
471
- };
472
- imports.wbg.__wbg_new0_25059e40b1c02766 = function() {
473
- const ret = new Date();
474
- return addHeapObject(ret);
459
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
460
+ const ret = getObject(arg0) == getObject(arg1);
461
+ return ret;
475
462
  };
476
- imports.wbg.__wbg_get_baf4855f9a986186 = function() { return handleError(function (arg0, arg1) {
477
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
478
- return addHeapObject(ret);
479
- }, arguments) };
480
463
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
481
464
  const obj = getObject(arg1);
482
465
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -485,22 +468,39 @@ function getImports() {
485
468
  getInt32Memory0()[arg0 / 4 + 1] = len0;
486
469
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
487
470
  };
471
+ imports.wbg.__wbg_new0_25059e40b1c02766 = function() {
472
+ const ret = new Date();
473
+ return addHeapObject(ret);
474
+ };
488
475
  imports.wbg.__wbg_getTimezoneOffset_2a6b27fb18493a56 = function(arg0) {
489
476
  const ret = getObject(arg0).getTimezoneOffset();
490
477
  return ret;
491
478
  };
492
- imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
493
- const ret = getObject(arg0)[getObject(arg1)];
479
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
480
+ const ret = getStringFromWasm0(arg0, arg1);
494
481
  return addHeapObject(ret);
495
482
  };
496
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
497
- const ret = getObject(arg0) === undefined;
483
+ imports.wbg.__wbg_get_baf4855f9a986186 = function() { return handleError(function (arg0, arg1) {
484
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
485
+ return addHeapObject(ret);
486
+ }, arguments) };
487
+ imports.wbg.__wbindgen_is_object = function(arg0) {
488
+ const val = getObject(arg0);
489
+ const ret = typeof(val) === 'object' && val !== null;
498
490
  return ret;
499
491
  };
500
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
501
- const ret = getObject(arg0) in getObject(arg1);
492
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
493
+ const v = getObject(arg0);
494
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
502
495
  return ret;
503
496
  };
497
+ imports.wbg.__wbg_new_b525de17f44a8943 = function() {
498
+ const ret = new Array();
499
+ return addHeapObject(ret);
500
+ };
501
+ imports.wbg.__wbg_set_17224bc548dd1d7b = function(arg0, arg1, arg2) {
502
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
503
+ };
504
504
  imports.wbg.__wbg_getTime_7c59072d1651a3cf = function(arg0) {
505
505
  const ret = getObject(arg0).getTime();
506
506
  return ret;
@@ -521,13 +521,6 @@ function getImports() {
521
521
  if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1); }
522
522
  console.error(v0);
523
523
  };
524
- imports.wbg.__wbg_subarray_7526649b91a252a6 = function(arg0, arg1, arg2) {
525
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
526
- return addHeapObject(ret);
527
- };
528
- imports.wbg.__wbg_getRandomValues_3774744e221a22ad = function() { return handleError(function (arg0, arg1) {
529
- getObject(arg0).getRandomValues(getObject(arg1));
530
- }, arguments) };
531
524
  imports.wbg.__wbindgen_memory = function() {
532
525
  const ret = wasm.memory;
533
526
  return addHeapObject(ret);
@@ -543,6 +536,13 @@ imports.wbg.__wbg_newwithbyteoffsetandlength_9fb2f11355ecadf5 = function(arg0, a
543
536
  imports.wbg.__wbg_randomFillSync_e950366c42764a07 = function() { return handleError(function (arg0, arg1) {
544
537
  getObject(arg0).randomFillSync(takeObject(arg1));
545
538
  }, arguments) };
539
+ imports.wbg.__wbg_subarray_7526649b91a252a6 = function(arg0, arg1, arg2) {
540
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
541
+ return addHeapObject(ret);
542
+ };
543
+ imports.wbg.__wbg_getRandomValues_3774744e221a22ad = function() { return handleError(function (arg0, arg1) {
544
+ getObject(arg0).getRandomValues(getObject(arg1));
545
+ }, arguments) };
546
546
  imports.wbg.__wbg_new_537b7341ce90bb31 = function(arg0) {
547
547
  const ret = new Uint8Array(getObject(arg0));
548
548
  return addHeapObject(ret);
@@ -706,6 +706,13 @@ imports.wbg.__wbg_length_e498fbc24f9c1d4f = function(arg0) {
706
706
  const ret = getObject(arg0).length;
707
707
  return ret;
708
708
  };
709
+ imports.wbg.__wbg_new_f9876326328f45ed = function() {
710
+ const ret = new Object();
711
+ return addHeapObject(ret);
712
+ };
713
+ imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
714
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
715
+ };
709
716
  imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
710
717
  try {
711
718
  var state0 = {a: arg0, b: arg1};
@@ -724,13 +731,6 @@ imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function(arg0, arg1) {
724
731
  state0.a = state0.b = 0;
725
732
  }
726
733
  };
727
- imports.wbg.__wbg_new_f9876326328f45ed = function() {
728
- const ret = new Object();
729
- return addHeapObject(ret);
730
- };
731
- imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
732
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
733
- };
734
734
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
735
735
  throw new Error(getStringFromWasm0(arg0, arg1));
736
736
  };
@@ -751,8 +751,8 @@ imports.wbg.__wbg_then_ec5db6d509eb475f = function(arg0, arg1) {
751
751
  const ret = getObject(arg0).then(getObject(arg1));
752
752
  return addHeapObject(ret);
753
753
  };
754
- imports.wbg.__wbindgen_closure_wrapper18514 = function(arg0, arg1, arg2) {
755
- const ret = makeMutClosure(arg0, arg1, 256, __wbg_adapter_46);
754
+ imports.wbg.__wbindgen_closure_wrapper18056 = function(arg0, arg1, arg2) {
755
+ const ret = makeMutClosure(arg0, arg1, 257, __wbg_adapter_46);
756
756
  return addHeapObject(ret);
757
757
  };
758
758
 
package/wasm_bg.wasm CHANGED
Binary file