@next/swc-wasm-nodejs 15.4.7 → 15.5.0

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-nodejs",
3
- "version": "15.4.7",
3
+ "version": "15.5.0",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -8,3 +8,4 @@ export function transformSync(s: any, opts: any): any;
8
8
  export function transform(s: any, opts: any): Promise<any>;
9
9
  export function parseSync(s: string, opts: any): any;
10
10
  export function parse(s: string, opts: any): Promise<any>;
11
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
package/wasm.js CHANGED
@@ -2,28 +2,9 @@
2
2
  let imports = {};
3
3
  imports['__wbindgen_placeholder__'] = module.exports;
4
4
  let wasm;
5
- const { TextDecoder, TextEncoder } = require(`util`);
5
+ const { TextEncoder, TextDecoder } = require(`util`);
6
6
 
7
- function addToExternrefTable0(obj) {
8
- const idx = wasm.__externref_table_alloc();
9
- wasm.__wbindgen_export_2.set(idx, obj);
10
- return idx;
11
- }
12
-
13
- function handleError(f, args) {
14
- try {
15
- return f.apply(this, args);
16
- } catch (e) {
17
- const idx = addToExternrefTable0(e);
18
- wasm.__wbindgen_exn_store(idx);
19
- }
20
- }
21
-
22
- function getFromExternrefTable0(idx) { return wasm.__wbindgen_export_2.get(idx); }
23
-
24
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
25
-
26
- cachedTextDecoder.decode();
7
+ let WASM_VECTOR_LEN = 0;
27
8
 
28
9
  let cachedUint8ArrayMemory0 = null;
29
10
 
@@ -34,26 +15,6 @@ function getUint8ArrayMemory0() {
34
15
  return cachedUint8ArrayMemory0;
35
16
  }
36
17
 
37
- function getStringFromWasm0(ptr, len) {
38
- ptr = ptr >>> 0;
39
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
40
- }
41
-
42
- function getCachedStringFromWasm0(ptr, len) {
43
- if (ptr === 0) {
44
- return getFromExternrefTable0(len);
45
- } else {
46
- return getStringFromWasm0(ptr, len);
47
- }
48
- }
49
-
50
- function getArrayU8FromWasm0(ptr, len) {
51
- ptr = ptr >>> 0;
52
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
53
- }
54
-
55
- let WASM_VECTOR_LEN = 0;
56
-
57
18
  let cachedTextEncoder = new TextEncoder('utf-8');
58
19
 
59
20
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -117,6 +78,45 @@ function getDataViewMemory0() {
117
78
  return cachedDataViewMemory0;
118
79
  }
119
80
 
81
+ function addToExternrefTable0(obj) {
82
+ const idx = wasm.__externref_table_alloc();
83
+ wasm.__wbindgen_export_4.set(idx, obj);
84
+ return idx;
85
+ }
86
+
87
+ function handleError(f, args) {
88
+ try {
89
+ return f.apply(this, args);
90
+ } catch (e) {
91
+ const idx = addToExternrefTable0(e);
92
+ wasm.__wbindgen_exn_store(idx);
93
+ }
94
+ }
95
+
96
+ function getFromExternrefTable0(idx) { return wasm.__wbindgen_export_4.get(idx); }
97
+
98
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
99
+
100
+ cachedTextDecoder.decode();
101
+
102
+ function getStringFromWasm0(ptr, len) {
103
+ ptr = ptr >>> 0;
104
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
105
+ }
106
+
107
+ function getCachedStringFromWasm0(ptr, len) {
108
+ if (ptr === 0) {
109
+ return getFromExternrefTable0(len);
110
+ } else {
111
+ return getStringFromWasm0(ptr, len);
112
+ }
113
+ }
114
+
115
+ function getArrayU8FromWasm0(ptr, len) {
116
+ ptr = ptr >>> 0;
117
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
118
+ }
119
+
120
120
  function isLikeNone(x) {
121
121
  return x === undefined || x === null;
122
122
  }
@@ -218,7 +218,7 @@ function debugString(val) {
218
218
  }
219
219
 
220
220
  function takeFromExternrefTable0(idx) {
221
- const value = wasm.__wbindgen_export_2.get(idx);
221
+ const value = wasm.__wbindgen_export_4.get(idx);
222
222
  wasm.__externref_table_dealloc(idx);
223
223
  return value;
224
224
  }
@@ -314,14 +314,53 @@ module.exports.parse = function(s, opts) {
314
314
  return ret;
315
315
  };
316
316
 
317
+ function passArray8ToWasm0(arg, malloc) {
318
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
319
+ getUint8ArrayMemory0().set(arg, ptr / 1);
320
+ WASM_VECTOR_LEN = arg.length;
321
+ return ptr;
322
+ }
323
+ /**
324
+ * @param {Uint8Array} content
325
+ * @param {string} template_path
326
+ * @param {string} next_package_dir_path
327
+ * @param {any} replacements
328
+ * @param {any} injections
329
+ * @param {any} imports
330
+ * @returns {string}
331
+ */
332
+ module.exports.expandNextJsTemplate = function(content, template_path, next_package_dir_path, replacements, injections, imports) {
333
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ const len1 = WASM_VECTOR_LEN;
337
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
+ const len2 = WASM_VECTOR_LEN;
339
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
340
+ if (ret[3]) {
341
+ throw takeFromExternrefTable0(ret[2]);
342
+ }
343
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
344
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
345
+ return v4;
346
+ };
347
+
317
348
  function __wbg_adapter_50(arg0, arg1, arg2) {
318
- wasm.closure1137_externref_shim(arg0, arg1, arg2);
349
+ wasm.closure1130_externref_shim(arg0, arg1, arg2);
319
350
  }
320
351
 
321
352
  function __wbg_adapter_101(arg0, arg1, arg2, arg3) {
322
- wasm.closure124_externref_shim(arg0, arg1, arg2, arg3);
353
+ wasm.closure123_externref_shim(arg0, arg1, arg2, arg3);
323
354
  }
324
355
 
356
+ module.exports.__wbg_String_fed4d24b68977888 = function(arg0, arg1) {
357
+ const ret = String(arg1);
358
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ const len1 = WASM_VECTOR_LEN;
360
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
361
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
362
+ };
363
+
325
364
  module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
326
365
  const ret = arg0.buffer;
327
366
  return ret;
@@ -591,8 +630,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
591
630
  return ret;
592
631
  };
593
632
 
594
- module.exports.__wbindgen_closure_wrapper23772 = function(arg0, arg1, arg2) {
595
- const ret = makeMutClosure(arg0, arg1, 1138, __wbg_adapter_50);
633
+ module.exports.__wbindgen_closure_wrapper23819 = function(arg0, arg1, arg2) {
634
+ const ret = makeMutClosure(arg0, arg1, 1131, __wbg_adapter_50);
596
635
  return ret;
597
636
  };
598
637
 
@@ -615,7 +654,7 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
615
654
  };
616
655
 
617
656
  module.exports.__wbindgen_init_externref_table = function() {
618
- const table = wasm.__wbindgen_export_2;
657
+ const table = wasm.__wbindgen_export_4;
619
658
  const offset = table.grow(4);
620
659
  table.set(0, undefined);
621
660
  table.set(offset + 0, undefined);
package/wasm_bg.wasm CHANGED
Binary file