oxc-parser
Advanced tools
+23
-23
| { | ||
| "name": "oxc-parser", | ||
| "version": "0.130.0", | ||
| "version": "0.131.0", | ||
| "description": "Oxc Parser Node API", | ||
@@ -62,3 +62,3 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@oxc-project/types": "^0.130.0" | ||
| "@oxc-project/types": "^0.131.0" | ||
| }, | ||
@@ -77,3 +77,3 @@ "devDependencies": { | ||
| "publint": "0.3.19", | ||
| "rolldown": "1.0.0", | ||
| "rolldown": "1.0.1", | ||
| "tinypool": "^2.0.0", | ||
@@ -118,22 +118,22 @@ "vitest": "4.1.5" | ||
| "optionalDependencies": { | ||
| "@oxc-parser/binding-darwin-arm64": "0.130.0", | ||
| "@oxc-parser/binding-android-arm64": "0.130.0", | ||
| "@oxc-parser/binding-win32-arm64-msvc": "0.130.0", | ||
| "@oxc-parser/binding-linux-arm64-gnu": "0.130.0", | ||
| "@oxc-parser/binding-linux-arm64-musl": "0.130.0", | ||
| "@oxc-parser/binding-openharmony-arm64": "0.130.0", | ||
| "@oxc-parser/binding-android-arm-eabi": "0.130.0", | ||
| "@oxc-parser/binding-linux-arm-gnueabihf": "0.130.0", | ||
| "@oxc-parser/binding-linux-arm-musleabihf": "0.130.0", | ||
| "@oxc-parser/binding-win32-ia32-msvc": "0.130.0", | ||
| "@oxc-parser/binding-linux-ppc64-gnu": "0.130.0", | ||
| "@oxc-parser/binding-linux-riscv64-gnu": "0.130.0", | ||
| "@oxc-parser/binding-linux-riscv64-musl": "0.130.0", | ||
| "@oxc-parser/binding-linux-s390x-gnu": "0.130.0", | ||
| "@oxc-parser/binding-wasm32-wasi": "0.130.0", | ||
| "@oxc-parser/binding-darwin-x64": "0.130.0", | ||
| "@oxc-parser/binding-win32-x64-msvc": "0.130.0", | ||
| "@oxc-parser/binding-freebsd-x64": "0.130.0", | ||
| "@oxc-parser/binding-linux-x64-gnu": "0.130.0", | ||
| "@oxc-parser/binding-linux-x64-musl": "0.130.0" | ||
| "@oxc-parser/binding-darwin-arm64": "0.131.0", | ||
| "@oxc-parser/binding-android-arm64": "0.131.0", | ||
| "@oxc-parser/binding-win32-arm64-msvc": "0.131.0", | ||
| "@oxc-parser/binding-linux-arm64-gnu": "0.131.0", | ||
| "@oxc-parser/binding-linux-arm64-musl": "0.131.0", | ||
| "@oxc-parser/binding-openharmony-arm64": "0.131.0", | ||
| "@oxc-parser/binding-android-arm-eabi": "0.131.0", | ||
| "@oxc-parser/binding-linux-arm-gnueabihf": "0.131.0", | ||
| "@oxc-parser/binding-linux-arm-musleabihf": "0.131.0", | ||
| "@oxc-parser/binding-win32-ia32-msvc": "0.131.0", | ||
| "@oxc-parser/binding-linux-ppc64-gnu": "0.131.0", | ||
| "@oxc-parser/binding-linux-riscv64-gnu": "0.131.0", | ||
| "@oxc-parser/binding-linux-riscv64-musl": "0.131.0", | ||
| "@oxc-parser/binding-linux-s390x-gnu": "0.131.0", | ||
| "@oxc-parser/binding-wasm32-wasi": "0.131.0", | ||
| "@oxc-parser/binding-darwin-x64": "0.131.0", | ||
| "@oxc-parser/binding-win32-x64-msvc": "0.131.0", | ||
| "@oxc-parser/binding-freebsd-x64": "0.131.0", | ||
| "@oxc-parser/binding-linux-x64-gnu": "0.131.0", | ||
| "@oxc-parser/binding-linux-x64-musl": "0.131.0" | ||
| }, | ||
@@ -140,0 +140,0 @@ "scripts": { |
+52
-52
@@ -84,4 +84,4 @@ // prettier-ignore | ||
| const bindingPackageVersion = require('@oxc-parser/binding-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -101,4 +101,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -123,4 +123,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -140,4 +140,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-win32-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -158,4 +158,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -175,4 +175,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-win32-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -195,4 +195,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -212,4 +212,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -229,4 +229,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -250,4 +250,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -267,4 +267,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -289,4 +289,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -306,4 +306,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -325,4 +325,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -342,4 +342,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -361,4 +361,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -378,4 +378,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -397,4 +397,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -414,4 +414,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -433,4 +433,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -450,4 +450,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -468,4 +468,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -485,4 +485,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -506,4 +506,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -523,4 +523,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -540,4 +540,4 @@ return binding | ||
| const bindingPackageVersion = require('@oxc-parser/binding-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.130.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.130.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.131.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.131.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -544,0 +544,0 @@ return binding |
| import os from "node:os"; | ||
| import { BLOCK_SIZE, BLOCK_ALIGN, BUFFER_SIZE, IS_TS_FLAG_POS } from "../generated/constants.js"; | ||
| import { | ||
| BLOCK_SIZE, | ||
| BLOCK_ALIGN, | ||
| BUFFER_SIZE, | ||
| ACTIVE_SIZE, | ||
| IS_TS_FLAG_POS, | ||
| } from "../generated/constants.js"; | ||
| import { | ||
| getBufferOffset, | ||
@@ -36,5 +42,5 @@ parseRaw as parseRawBinding, | ||
| export function parseSyncRawImpl(filename, sourceText, options, convert) { | ||
| const { buffer, sourceByteLen } = prepareRaw(sourceText); | ||
| parseRawSyncBinding(filename, buffer.block, sourceByteLen, options); | ||
| return convert(buffer, sourceText, sourceByteLen, options); | ||
| const { buffer, sourceStartPos, sourceByteLen } = prepareRaw(sourceText); | ||
| parseRawSyncBinding(filename, buffer.block, sourceStartPos, sourceByteLen, options); | ||
| return convert(buffer, sourceText, sourceStartPos, sourceByteLen, options); | ||
| } | ||
@@ -117,5 +123,5 @@ | ||
| // Parse | ||
| const { buffer, sourceByteLen } = prepareRaw(sourceText); | ||
| await parseRawBinding(filename, buffer.block, sourceByteLen, options); | ||
| const data = convert(buffer, sourceText, sourceByteLen, options); | ||
| const { buffer, sourceStartPos, sourceByteLen } = prepareRaw(sourceText); | ||
| await parseRawBinding(filename, buffer.block, sourceStartPos, sourceByteLen, options); | ||
| const data = convert(buffer, sourceText, sourceStartPos, sourceByteLen, options); | ||
@@ -179,4 +185,5 @@ // Free the CPU core | ||
| * @param {string} sourceText - Source text of file | ||
| * @returns {Object} - Object of form `{ buffer, sourceByteLen }`. | ||
| * @returns {Object} - Object of form `{ buffer, sourceStartPos, sourceByteLen }`. | ||
| * - `buffer`: `Uint8Array` containing the AST in raw form. | ||
| * - `sourceStartPos`: Position of first byte of source text in buffer | ||
| * - `sourceByteLen`: Length of source text in UTF-8 bytes | ||
@@ -206,10 +213,21 @@ * (which may not be equal to `sourceText.length` if source contains non-ASCII characters). | ||
| // Write source into start of buffer. | ||
| // `TextEncoder` cannot write into a `Uint8Array` larger than 1 GiB, | ||
| // so create a view into buffer of this size to write into. | ||
| const sourceBuffer = new Uint8Array(buffer.buffer, buffer.byteOffset, ONE_GIB); | ||
| // Write source into end of buffer. | ||
| // Maximum size of a string encoded in UTF-8 is 3 x the length of the string in UTF-16 characters | ||
| // (a source which consists entirely of 3-byte UTF-8 characters). | ||
| // We can't predict how many bytes will be needed exactly in advance of encoding, so we reserve | ||
| // the maximum theoretically possible number of bytes required. | ||
| // `TextEncoder` cannot write into a `Uint8Array` larger than 1 GiB, so size is capped at 1 GiB. | ||
| const maxSourceByteLen = sourceText.length * 3; | ||
| if (maxSourceByteLen > ONE_GIB) throw new Error("Source text is too long"); | ||
| const sourceStartPos = ACTIVE_SIZE - maxSourceByteLen; | ||
| const sourceBuffer = new Uint8Array( | ||
| buffer.buffer, | ||
| buffer.byteOffset + sourceStartPos, | ||
| maxSourceByteLen, | ||
| ); | ||
| const { read, written: sourceByteLen } = textEncoder.encodeInto(sourceText, sourceBuffer); | ||
| if (read !== sourceText.length) throw new Error("Failed to write source text into buffer"); | ||
| return { buffer, sourceByteLen }; | ||
| return { buffer, sourceStartPos, sourceByteLen }; | ||
| } | ||
@@ -216,0 +234,0 @@ |
@@ -61,2 +61,3 @@ import { createRequire } from "node:module"; | ||
| * @param {string} sourceText - Source for the file | ||
| * @param {number} sourceStartPos - Position of first byte of source text in buffer | ||
| * @param {number} sourceByteLen - Length of source text in UTF-8 bytes | ||
@@ -66,3 +67,3 @@ * @param {Object} options - Parsing options | ||
| */ | ||
| function deserialize(buffer, sourceText, sourceByteLen, options) { | ||
| function deserialize(buffer, sourceText, sourceStartPos, sourceByteLen, options) { | ||
| const isJs = isJsAst(buffer), | ||
@@ -81,3 +82,3 @@ range = !!options.range, | ||
| const data = deserializeThis(buffer, sourceText, sourceByteLen); | ||
| const data = deserializeThis(buffer, sourceText, sourceStartPos, sourceByteLen); | ||
@@ -84,0 +85,0 @@ // Add a line comment for hashbang if JS. |
@@ -86,2 +86,3 @@ import { DATA_POINTER_POS_32, PROGRAM_OFFSET } from "../generated/constants.js"; | ||
| * @param {string} sourceText - Source for the file | ||
| * @param {number} sourceStartPos - Position of first byte of source text in buffer | ||
| * @param {number} sourceByteLen - Length of source text in UTF-8 bytes | ||
@@ -92,6 +93,14 @@ * @param {Object} _options - Parsing options | ||
| */ | ||
| function construct(buffer, sourceText, sourceByteLen, _options) { | ||
| function construct(buffer, sourceText, sourceStartPos, sourceByteLen, _options) { | ||
| // Create AST object | ||
| const sourceIsAscii = sourceText.length === sourceByteLen; | ||
| const ast = { buffer, sourceText, sourceByteLen, sourceIsAscii, nodes: new Map(), token: TOKEN }; | ||
| const ast = { | ||
| buffer, | ||
| sourceText, | ||
| sourceStartPos, | ||
| sourceByteLen, | ||
| sourceIsAscii, | ||
| nodes: new Map(), | ||
| token: TOKEN, | ||
| }; | ||
@@ -98,0 +107,0 @@ // Register `ast` with the recycle registry so buffer is returned to cache |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
1380528
0.27%45372
0.19%63
-1.56%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated