@oxc-parser/binding-wasm32-wasi 0.66.0 → 0.67.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/browser-bundle.mjs +16 -17
- package/package.json +1 -1
- package/parser.wasm32-wasi.wasm +0 -0
package/browser-bundle.mjs
CHANGED
|
@@ -12671,9 +12671,7 @@ function wrap(result) {
|
|
|
12671
12671
|
let program, module, comments, errors;
|
|
12672
12672
|
return {
|
|
12673
12673
|
get program() {
|
|
12674
|
-
if (!program)
|
|
12675
|
-
program = jsonParseAst(result.program);
|
|
12676
|
-
}
|
|
12674
|
+
if (!program) program = jsonParseAst(result.program);
|
|
12677
12675
|
return program;
|
|
12678
12676
|
},
|
|
12679
12677
|
get module() {
|
|
@@ -12690,22 +12688,23 @@ function wrap(result) {
|
|
|
12690
12688
|
}
|
|
12691
12689
|
};
|
|
12692
12690
|
}
|
|
12693
|
-
function jsonParseAst(
|
|
12694
|
-
return JSON.parse(
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12691
|
+
function jsonParseAst(program) {
|
|
12692
|
+
return JSON.parse(program, transform);
|
|
12693
|
+
}
|
|
12694
|
+
function transform(key, value) {
|
|
12695
|
+
if (value === null && key === "value" && Object.hasOwn(this, "type") && this.type === "Literal") {
|
|
12696
|
+
if (Object.hasOwn(this, "bigint")) {
|
|
12697
|
+
return BigInt(this.bigint);
|
|
12698
|
+
}
|
|
12699
|
+
if (Object.hasOwn(this, "regex")) {
|
|
12700
|
+
const { regex } = this;
|
|
12701
|
+
try {
|
|
12702
|
+
return RegExp(regex.pattern, regex.flags);
|
|
12703
|
+
} catch (_err) {
|
|
12705
12704
|
}
|
|
12706
12705
|
}
|
|
12707
|
-
|
|
12708
|
-
|
|
12706
|
+
}
|
|
12707
|
+
return value;
|
|
12709
12708
|
}
|
|
12710
12709
|
|
|
12711
12710
|
// wasm.mjs
|
package/package.json
CHANGED
package/parser.wasm32-wasi.wasm
CHANGED
|
Binary file
|