@next/swc-wasm-nodejs 16.1.4 → 16.2.0-canary.1

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": "16.1.4",
3
+ "version": "16.2.0-canary.1",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function mdxCompile(value: string, opts: any): Promise<any>;
4
- export function mdxCompileSync(value: string, opts: any): any;
5
- export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
3
+ export function minifySync(s: string, opts: any): any;
4
+ export function minify(s: string, opts: any): Promise<any>;
5
+ export function transformSync(s: any, opts: any): any;
6
6
  export function transform(s: any, opts: any): Promise<any>;
7
7
  export function parseSync(s: string, opts: any): any;
8
8
  export function parse(s: string, opts: any): Promise<any>;
9
- export function transformSync(s: any, opts: any): any;
10
- export function minifySync(s: string, opts: any): any;
11
- export function minify(s: string, opts: any): Promise<any>;
9
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
10
+ export function mdxCompileSync(value: string, opts: any): any;
11
+ export function mdxCompile(value: string, opts: any): Promise<any>;
package/wasm.js CHANGED
@@ -216,15 +216,6 @@ function debugString(val) {
216
216
  // TODO we could test for more things here, like `Set`s and `Map`s.
217
217
  return className;
218
218
  }
219
- /**
220
- * @param {string} value
221
- * @param {any} opts
222
- * @returns {Promise<any>}
223
- */
224
- module.exports.mdxCompile = function(value, opts) {
225
- const ret = wasm.mdxCompile(value, opts);
226
- return ret;
227
- };
228
219
 
229
220
  function takeFromExternrefTable0(idx) {
230
221
  const value = wasm.__wbindgen_export_4.get(idx);
@@ -232,47 +223,39 @@ function takeFromExternrefTable0(idx) {
232
223
  return value;
233
224
  }
234
225
  /**
235
- * @param {string} value
226
+ * @param {string} s
236
227
  * @param {any} opts
237
228
  * @returns {any}
238
229
  */
239
- module.exports.mdxCompileSync = function(value, opts) {
240
- const ret = wasm.mdxCompileSync(value, opts);
230
+ module.exports.minifySync = function(s, opts) {
231
+ const ret = wasm.minifySync(s, opts);
241
232
  if (ret[2]) {
242
233
  throw takeFromExternrefTable0(ret[1]);
243
234
  }
244
235
  return takeFromExternrefTable0(ret[0]);
245
236
  };
246
237
 
247
- function passArray8ToWasm0(arg, malloc) {
248
- const ptr = malloc(arg.length * 1, 1) >>> 0;
249
- getUint8ArrayMemory0().set(arg, ptr / 1);
250
- WASM_VECTOR_LEN = arg.length;
251
- return ptr;
252
- }
253
238
  /**
254
- * @param {Uint8Array} content
255
- * @param {string} template_path
256
- * @param {string} next_package_dir_path
257
- * @param {any} replacements
258
- * @param {any} injections
259
- * @param {any} imports
260
- * @returns {string}
239
+ * @param {string} s
240
+ * @param {any} opts
241
+ * @returns {Promise<any>}
261
242
  */
262
- module.exports.expandNextJsTemplate = function(content, template_path, next_package_dir_path, replacements, injections, imports) {
263
- const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
264
- const len0 = WASM_VECTOR_LEN;
265
- const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
266
- const len1 = WASM_VECTOR_LEN;
267
- const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
268
- const len2 = WASM_VECTOR_LEN;
269
- const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
270
- if (ret[3]) {
271
- throw takeFromExternrefTable0(ret[2]);
243
+ module.exports.minify = function(s, opts) {
244
+ const ret = wasm.minify(s, opts);
245
+ return ret;
246
+ };
247
+
248
+ /**
249
+ * @param {any} s
250
+ * @param {any} opts
251
+ * @returns {any}
252
+ */
253
+ module.exports.transformSync = function(s, opts) {
254
+ const ret = wasm.transformSync(s, opts);
255
+ if (ret[2]) {
256
+ throw takeFromExternrefTable0(ret[1]);
272
257
  }
273
- var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
274
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
275
- return v4;
258
+ return takeFromExternrefTable0(ret[0]);
276
259
  };
277
260
 
278
261
  /**
@@ -308,26 +291,44 @@ module.exports.parse = function(s, opts) {
308
291
  return ret;
309
292
  };
310
293
 
294
+ function passArray8ToWasm0(arg, malloc) {
295
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
296
+ getUint8ArrayMemory0().set(arg, ptr / 1);
297
+ WASM_VECTOR_LEN = arg.length;
298
+ return ptr;
299
+ }
311
300
  /**
312
- * @param {any} s
313
- * @param {any} opts
314
- * @returns {any}
301
+ * @param {Uint8Array} content
302
+ * @param {string} template_path
303
+ * @param {string} next_package_dir_path
304
+ * @param {any} replacements
305
+ * @param {any} injections
306
+ * @param {any} imports
307
+ * @returns {string}
315
308
  */
316
- module.exports.transformSync = function(s, opts) {
317
- const ret = wasm.transformSync(s, opts);
318
- if (ret[2]) {
319
- throw takeFromExternrefTable0(ret[1]);
309
+ module.exports.expandNextJsTemplate = function(content, template_path, next_package_dir_path, replacements, injections, imports) {
310
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
311
+ const len0 = WASM_VECTOR_LEN;
312
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
313
+ const len1 = WASM_VECTOR_LEN;
314
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
+ const len2 = WASM_VECTOR_LEN;
316
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
317
+ if (ret[3]) {
318
+ throw takeFromExternrefTable0(ret[2]);
320
319
  }
321
- return takeFromExternrefTable0(ret[0]);
320
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
321
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
322
+ return v4;
322
323
  };
323
324
 
324
325
  /**
325
- * @param {string} s
326
+ * @param {string} value
326
327
  * @param {any} opts
327
328
  * @returns {any}
328
329
  */
329
- module.exports.minifySync = function(s, opts) {
330
- const ret = wasm.minifySync(s, opts);
330
+ module.exports.mdxCompileSync = function(value, opts) {
331
+ const ret = wasm.mdxCompileSync(value, opts);
331
332
  if (ret[2]) {
332
333
  throw takeFromExternrefTable0(ret[1]);
333
334
  }
@@ -335,21 +336,21 @@ module.exports.minifySync = function(s, opts) {
335
336
  };
336
337
 
337
338
  /**
338
- * @param {string} s
339
+ * @param {string} value
339
340
  * @param {any} opts
340
341
  * @returns {Promise<any>}
341
342
  */
342
- module.exports.minify = function(s, opts) {
343
- const ret = wasm.minify(s, opts);
343
+ module.exports.mdxCompile = function(value, opts) {
344
+ const ret = wasm.mdxCompile(value, opts);
344
345
  return ret;
345
346
  };
346
347
 
347
348
  function __wbg_adapter_50(arg0, arg1, arg2) {
348
- wasm.closure1162_externref_shim(arg0, arg1, arg2);
349
+ wasm.closure1211_externref_shim(arg0, arg1, arg2);
349
350
  }
350
351
 
351
- function __wbg_adapter_79(arg0, arg1, arg2, arg3) {
352
- wasm.closure126_externref_shim(arg0, arg1, arg2, arg3);
352
+ function __wbg_adapter_89(arg0, arg1, arg2, arg3) {
353
+ wasm.closure124_externref_shim(arg0, arg1, arg2, arg3);
353
354
  }
354
355
 
355
356
  module.exports.__wbg_String_fed4d24b68977888 = function(arg0, arg1) {
@@ -479,7 +480,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
479
480
  const a = state0.a;
480
481
  state0.a = 0;
481
482
  try {
482
- return __wbg_adapter_79(a, state0.b, arg0, arg1);
483
+ return __wbg_adapter_89(a, state0.b, arg0, arg1);
483
484
  } finally {
484
485
  state0.a = a;
485
486
  }
@@ -629,8 +630,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
629
630
  return ret;
630
631
  };
631
632
 
632
- module.exports.__wbindgen_closure_wrapper23445 = function(arg0, arg1, arg2) {
633
- const ret = makeMutClosure(arg0, arg1, 1163, __wbg_adapter_50);
633
+ module.exports.__wbindgen_closure_wrapper25309 = function(arg0, arg1, arg2) {
634
+ const ret = makeMutClosure(arg0, arg1, 1212, __wbg_adapter_50);
634
635
  return ret;
635
636
  };
636
637
 
package/wasm_bg.wasm CHANGED
Binary file