@oxc-parser/binding-wasm32-wasi 0.68.0 → 0.69.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 +17 -14
- package/package.json +1 -1
- package/parser.wasm32-wasi.wasm +0 -0
package/browser-bundle.mjs
CHANGED
|
@@ -12688,23 +12688,26 @@ function wrap(result) {
|
|
|
12688
12688
|
}
|
|
12689
12689
|
};
|
|
12690
12690
|
}
|
|
12691
|
-
function jsonParseAst(
|
|
12692
|
-
|
|
12691
|
+
function jsonParseAst(programJson) {
|
|
12692
|
+
const { node: program, fixes } = JSON.parse(programJson);
|
|
12693
|
+
for (const fixPath of fixes) {
|
|
12694
|
+
applyFix(program, fixPath);
|
|
12695
|
+
}
|
|
12696
|
+
return program;
|
|
12693
12697
|
}
|
|
12694
|
-
function
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12698
|
+
function applyFix(program, fixPath) {
|
|
12699
|
+
let node = program;
|
|
12700
|
+
for (const key of fixPath) {
|
|
12701
|
+
node = node[key];
|
|
12702
|
+
}
|
|
12703
|
+
if (node.bigint) {
|
|
12704
|
+
node.value = BigInt(node.bigint);
|
|
12705
|
+
} else {
|
|
12706
|
+
try {
|
|
12707
|
+
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
12708
|
+
} catch (_err) {
|
|
12705
12709
|
}
|
|
12706
12710
|
}
|
|
12707
|
-
return value;
|
|
12708
12711
|
}
|
|
12709
12712
|
|
|
12710
12713
|
// wasm.mjs
|
package/package.json
CHANGED
package/parser.wasm32-wasi.wasm
CHANGED
|
Binary file
|