@cnpmjs/packument
Advanced tools
+2
-0
@@ -115,2 +115,4 @@ /* auto-generated by NAPI-RS */ | ||
| export declare function hasIn(data: Uint8Array, paths: Array<string>): boolean | ||
| /** | ||
@@ -117,0 +119,0 @@ * Human metadata |
+60
-58
@@ -6,4 +6,5 @@ // prettier-ignore | ||
| const { createRequire } = require('node:module') | ||
| require = createRequire(__filename) | ||
| import { createRequire } from 'node:module' | ||
| const require = createRequire(import.meta.url) | ||
| const __dirname = new URL('.', import.meta.url).pathname | ||
@@ -84,4 +85,4 @@ const { readFileSync } = require('node:fs') | ||
| const bindingPackageVersion = require('@cnpmjs/packument-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -101,4 +102,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -122,4 +123,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-win32-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -139,4 +140,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -156,4 +157,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-win32-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -176,4 +177,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -193,4 +194,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -210,4 +211,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -231,4 +232,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -248,4 +249,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -270,4 +271,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -287,4 +288,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -306,4 +307,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -323,4 +324,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -342,4 +343,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -359,4 +360,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -378,4 +379,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -395,4 +396,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -414,4 +415,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -431,4 +432,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -449,4 +450,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -466,4 +467,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -487,4 +488,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -504,4 +505,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -521,4 +522,4 @@ return binding | ||
| const bindingPackageVersion = require('@cnpmjs/packument-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '1.2.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '1.3.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 1.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -585,7 +586,8 @@ return binding | ||
| module.exports = nativeBinding | ||
| module.exports.Package = nativeBinding.Package | ||
| module.exports.DeletePropertyKind = nativeBinding.DeletePropertyKind | ||
| module.exports.detectDeletePropertyPosition = nativeBinding.detectDeletePropertyPosition | ||
| module.exports.detectSetPropertyPosition = nativeBinding.detectSetPropertyPosition | ||
| module.exports.SetPropertyKind = nativeBinding.SetPropertyKind | ||
| const { Package, DeletePropertyKind, detectDeletePropertyPosition, detectSetPropertyPosition, hasIn, SetPropertyKind } = nativeBinding | ||
| export { Package } | ||
| export { DeletePropertyKind } | ||
| export { detectDeletePropertyPosition } | ||
| export { detectSetPropertyPosition } | ||
| export { hasIn } | ||
| export { SetPropertyKind } |
+2
-1
@@ -1,2 +0,2 @@ | ||
| export type SetValue = string | number | boolean | Date | object; | ||
| export type SetValue = string | number | boolean | Date | object | Buffer; | ||
| export interface DeleteOptions { | ||
@@ -14,3 +14,4 @@ /** | ||
| deleteIn(paths: string[], options?: DeleteOptions): this; | ||
| hasIn(paths: string[]): boolean; | ||
| build(): Buffer; | ||
| } |
+10
-4
@@ -1,2 +0,2 @@ | ||
| import { detectDeletePropertyPosition, detectSetPropertyPosition, } from '../index.js'; | ||
| import { detectDeletePropertyPosition, detectSetPropertyPosition, hasIn, } from '../index.js'; | ||
| export class JSONBuilder { | ||
@@ -22,7 +22,7 @@ #data; | ||
| } | ||
| const valueBuffer = Buffer.isBuffer(value) ? value : Buffer.from(JSON.stringify(value)); | ||
| if (result.kind === "Update" /* SetPropertyKind.Update */) { | ||
| const updateBuffer = Buffer.from(JSON.stringify(value)); | ||
| this.#data = this.#concatBuffers([ | ||
| this.#data.subarray(0, result.start), | ||
| updateBuffer, | ||
| valueBuffer, | ||
| this.#data.subarray(result.end), | ||
@@ -37,3 +37,3 @@ ]); | ||
| const property = paths[paths.length - 1]; | ||
| const addBuffer = Buffer.from(`${JSON.stringify(property)}:${JSON.stringify(value)}`); | ||
| const addBuffer = Buffer.concat([Buffer.from(`${JSON.stringify(property)}:`), valueBuffer]); | ||
| if (result.previous) { | ||
@@ -76,2 +76,8 @@ // has previous property, add the new property after the previous property | ||
| } | ||
| hasIn(paths) { | ||
| if (paths.length === 0) { | ||
| throw new TypeError('paths should not be empty array'); | ||
| } | ||
| return hasIn(this.#data, paths); | ||
| } | ||
| build() { | ||
@@ -78,0 +84,0 @@ return this.#data; |
+12
-4
@@ -5,6 +5,7 @@ import { | ||
| detectSetPropertyPosition, | ||
| hasIn, | ||
| SetPropertyKind, | ||
| } from '../index.js' | ||
| export type SetValue = string | number | boolean | Date | object | ||
| export type SetValue = string | number | boolean | Date | object | Buffer | ||
@@ -44,7 +45,7 @@ export interface DeleteOptions { | ||
| const valueBuffer = Buffer.isBuffer(value) ? value : Buffer.from(JSON.stringify(value)) | ||
| if (result.kind === SetPropertyKind.Update) { | ||
| const updateBuffer = Buffer.from(JSON.stringify(value)) | ||
| this.#data = this.#concatBuffers([ | ||
| this.#data.subarray(0, result.start), | ||
| updateBuffer, | ||
| valueBuffer, | ||
| this.#data.subarray(result.end), | ||
@@ -61,3 +62,3 @@ ]) | ||
| const property = paths[paths.length - 1] | ||
| const addBuffer = Buffer.from(`${JSON.stringify(property)}:${JSON.stringify(value)}`) | ||
| const addBuffer = Buffer.concat([Buffer.from(`${JSON.stringify(property)}:`), valueBuffer]) | ||
| if (result.previous) { | ||
@@ -101,2 +102,9 @@ // has previous property, add the new property after the previous property | ||
| hasIn(paths: string[]): boolean { | ||
| if (paths.length === 0) { | ||
| throw new TypeError('paths should not be empty array') | ||
| } | ||
| return hasIn(this.#data, paths) | ||
| } | ||
| build(): Buffer { | ||
@@ -103,0 +111,0 @@ return this.#data |
+11
-10
| { | ||
| "name": "@cnpmjs/packument", | ||
| "version": "1.2.1", | ||
| "version": "1.3.0", | ||
| "description": "Packument helper", | ||
@@ -55,2 +55,3 @@ "repository": { | ||
| "scripts": { | ||
| "ready": "yarn build && yarn lint && yarn test", | ||
| "artifacts": "napi artifacts", | ||
@@ -69,3 +70,3 @@ "prebench": "yarn build", | ||
| "test": "vitest run", | ||
| "preversion": "napi build --platform && git add .", | ||
| "preversion": "napi build --platform --esm && git add .", | ||
| "version": "napi version", | ||
@@ -116,11 +117,11 @@ "prepare": "husky" | ||
| "optionalDependencies": { | ||
| "@cnpmjs/packument-win32-x64-msvc": "1.2.1", | ||
| "@cnpmjs/packument-darwin-x64": "1.2.1", | ||
| "@cnpmjs/packument-linux-x64-gnu": "1.2.1", | ||
| "@cnpmjs/packument-linux-x64-musl": "1.2.1", | ||
| "@cnpmjs/packument-linux-arm64-gnu": "1.2.1", | ||
| "@cnpmjs/packument-darwin-arm64": "1.2.1", | ||
| "@cnpmjs/packument-linux-arm64-musl": "1.2.1", | ||
| "@cnpmjs/packument-win32-arm64-msvc": "1.2.1" | ||
| "@cnpmjs/packument-win32-x64-msvc": "1.3.0", | ||
| "@cnpmjs/packument-darwin-x64": "1.3.0", | ||
| "@cnpmjs/packument-linux-x64-gnu": "1.3.0", | ||
| "@cnpmjs/packument-linux-x64-musl": "1.3.0", | ||
| "@cnpmjs/packument-linux-arm64-gnu": "1.3.0", | ||
| "@cnpmjs/packument-darwin-arm64": "1.3.0", | ||
| "@cnpmjs/packument-linux-arm64-musl": "1.3.0", | ||
| "@cnpmjs/packument-win32-arm64-msvc": "1.3.0" | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
67213
0.92%945
1.83%