@next/swc-wasm-nodejs 16.0.2-canary.10 → 16.0.2-canary.12

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.0.2-canary.10",
3
+ "version": "16.0.2-canary.12",
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 parse(s: string, opts: any): Promise<any>;
4
- export function transform(s: any, opts: any): Promise<any>;
3
+ export function transformSync(s: any, opts: any): any;
4
+ export function parseSync(s: string, opts: any): any;
5
5
  export function minify(s: string, opts: any): Promise<any>;
6
6
  export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
7
- export function parseSync(s: string, opts: any): any;
8
- export function transformSync(s: any, opts: any): any;
7
+ export function parse(s: string, opts: any): Promise<any>;
9
8
  export function minifySync(s: string, opts: any): any;
10
- export function mdxCompileSync(value: string, opts: any): any;
9
+ export function transform(s: any, opts: any): Promise<any>;
11
10
  export function mdxCompile(value: string, opts: any): Promise<any>;
11
+ export function mdxCompileSync(value: string, opts: any): any;
package/wasm.js CHANGED
@@ -216,24 +216,36 @@ 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
+ function takeFromExternrefTable0(idx) {
221
+ const value = wasm.__wbindgen_export_4.get(idx);
222
+ wasm.__externref_table_dealloc(idx);
223
+ return value;
224
+ }
219
225
  /**
220
- * @param {string} s
226
+ * @param {any} s
221
227
  * @param {any} opts
222
- * @returns {Promise<any>}
228
+ * @returns {any}
223
229
  */
224
- module.exports.parse = function(s, opts) {
225
- const ret = wasm.parse(s, opts);
226
- return ret;
230
+ module.exports.transformSync = function(s, opts) {
231
+ const ret = wasm.transformSync(s, opts);
232
+ if (ret[2]) {
233
+ throw takeFromExternrefTable0(ret[1]);
234
+ }
235
+ return takeFromExternrefTable0(ret[0]);
227
236
  };
228
237
 
229
238
  /**
230
- * @param {any} s
239
+ * @param {string} s
231
240
  * @param {any} opts
232
- * @returns {Promise<any>}
241
+ * @returns {any}
233
242
  */
234
- module.exports.transform = function(s, opts) {
235
- const ret = wasm.transform(s, opts);
236
- return ret;
243
+ module.exports.parseSync = function(s, opts) {
244
+ const ret = wasm.parseSync(s, opts);
245
+ if (ret[2]) {
246
+ throw takeFromExternrefTable0(ret[1]);
247
+ }
248
+ return takeFromExternrefTable0(ret[0]);
237
249
  };
238
250
 
239
251
  /**
@@ -252,12 +264,6 @@ function passArray8ToWasm0(arg, malloc) {
252
264
  WASM_VECTOR_LEN = arg.length;
253
265
  return ptr;
254
266
  }
255
-
256
- function takeFromExternrefTable0(idx) {
257
- const value = wasm.__wbindgen_export_4.get(idx);
258
- wasm.__externref_table_dealloc(idx);
259
- return value;
260
- }
261
267
  /**
262
268
  * @param {Uint8Array} content
263
269
  * @param {string} template_path
@@ -283,13 +289,23 @@ module.exports.expandNextJsTemplate = function(content, template_path, next_pack
283
289
  return v4;
284
290
  };
285
291
 
292
+ /**
293
+ * @param {string} s
294
+ * @param {any} opts
295
+ * @returns {Promise<any>}
296
+ */
297
+ module.exports.parse = function(s, opts) {
298
+ const ret = wasm.parse(s, opts);
299
+ return ret;
300
+ };
301
+
286
302
  /**
287
303
  * @param {string} s
288
304
  * @param {any} opts
289
305
  * @returns {any}
290
306
  */
291
- module.exports.parseSync = function(s, opts) {
292
- const ret = wasm.parseSync(s, opts);
307
+ module.exports.minifySync = function(s, opts) {
308
+ const ret = wasm.minifySync(s, opts);
293
309
  if (ret[2]) {
294
310
  throw takeFromExternrefTable0(ret[1]);
295
311
  }
@@ -299,27 +315,21 @@ module.exports.parseSync = function(s, opts) {
299
315
  /**
300
316
  * @param {any} s
301
317
  * @param {any} opts
302
- * @returns {any}
318
+ * @returns {Promise<any>}
303
319
  */
304
- module.exports.transformSync = function(s, opts) {
305
- const ret = wasm.transformSync(s, opts);
306
- if (ret[2]) {
307
- throw takeFromExternrefTable0(ret[1]);
308
- }
309
- return takeFromExternrefTable0(ret[0]);
320
+ module.exports.transform = function(s, opts) {
321
+ const ret = wasm.transform(s, opts);
322
+ return ret;
310
323
  };
311
324
 
312
325
  /**
313
- * @param {string} s
326
+ * @param {string} value
314
327
  * @param {any} opts
315
- * @returns {any}
328
+ * @returns {Promise<any>}
316
329
  */
317
- module.exports.minifySync = function(s, opts) {
318
- const ret = wasm.minifySync(s, opts);
319
- if (ret[2]) {
320
- throw takeFromExternrefTable0(ret[1]);
321
- }
322
- return takeFromExternrefTable0(ret[0]);
330
+ module.exports.mdxCompile = function(value, opts) {
331
+ const ret = wasm.mdxCompile(value, opts);
332
+ return ret;
323
333
  };
324
334
 
325
335
  /**
@@ -335,16 +345,6 @@ module.exports.mdxCompileSync = function(value, opts) {
335
345
  return takeFromExternrefTable0(ret[0]);
336
346
  };
337
347
 
338
- /**
339
- * @param {string} value
340
- * @param {any} opts
341
- * @returns {Promise<any>}
342
- */
343
- module.exports.mdxCompile = function(value, opts) {
344
- const ret = wasm.mdxCompile(value, opts);
345
- return ret;
346
- };
347
-
348
348
  function __wbg_adapter_50(arg0, arg1, arg2) {
349
349
  wasm.closure1163_externref_shim(arg0, arg1, arg2);
350
350
  }
@@ -630,7 +630,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
630
630
  return ret;
631
631
  };
632
632
 
633
- module.exports.__wbindgen_closure_wrapper23888 = function(arg0, arg1, arg2) {
633
+ module.exports.__wbindgen_closure_wrapper23887 = function(arg0, arg1, arg2) {
634
634
  const ret = makeMutClosure(arg0, arg1, 1164, __wbg_adapter_50);
635
635
  return ret;
636
636
  };
package/wasm_bg.wasm CHANGED
Binary file