@swc-next/core-binding-wasm 0.2.2 → 0.2.4

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": "@swc-next/core-binding-wasm",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "The extensible Node.js API for SWC Next",
5
5
  "type": "module",
6
6
  "main": "./swc-next-core.node.mjs",
@@ -33,12 +33,12 @@ export function langFromPath(path) {
33
33
  return decodeEnum(result, langValues, "lang");
34
34
  }
35
35
 
36
- export function parseSync(source, options) {
36
+ export function parseSync(source, sourceUtf16Len, options) {
37
37
  const call = getFunction("__swc_parse_sync");
38
- if (typeof source !== "string") throw new TypeError("source must be a string");
39
- const resultPointer = (withEncodedString(
38
+ if (!(source instanceof Uint8Array)) throw new TypeError("source must be a Uint8Array");
39
+ const resultPointer = (withEncodedBytes(
40
40
  source,
41
- (sourcePointer) => call(sourcePointer, encodeU32(options, "options")),
41
+ (sourcePointer) => call(sourcePointer, encodeU32(sourceUtf16Len, "sourceUtf16Len"), encodeU32(options, "options")),
42
42
  )) >>> 0;
43
43
  return takeBytes(resultPointer);
44
44
  }
@@ -3,7 +3,7 @@ import { initializeAsync } from "./swc-next-core.runtime.mjs";
3
3
 
4
4
  export * from "./swc-next-core.bridge.mjs";
5
5
 
6
- export const version = "0.2.2";
6
+ export const version = "0.2.4";
7
7
 
8
8
  export default function init() {
9
9
  return initializeAsync(() =>
@@ -7,7 +7,7 @@ initializeSync(wasm);
7
7
 
8
8
  export * from "./swc-next-core.bridge.mjs";
9
9
 
10
- export const version = "0.2.2";
10
+ export const version = "0.2.4";
11
11
 
12
12
  export default function init() {
13
13
  return Promise.resolve();
@@ -7,7 +7,7 @@ initializeSync(readFileSync(new URL("./swc-next-core.wasm", import.meta.url)));
7
7
 
8
8
  export * from "./swc-next-core.bridge.mjs";
9
9
 
10
- export const version = "0.2.2";
10
+ export const version = "0.2.4";
11
11
 
12
12
  export default function init() {
13
13
  return Promise.resolve();
Binary file