napi-postinstall
Advanced tools
+24
-1
@@ -149,3 +149,8 @@ "use strict"; | ||
| if (process.arch === 'x64') { | ||
| return 'win32-x64-msvc'; | ||
| const targets = []; | ||
| if (process.report.getReport().header?.osName?.startsWith('MINGW')) { | ||
| targets.push('win32-x64-gnu'); | ||
| } | ||
| targets.push('win32-x64-msvc'); | ||
| return targets; | ||
| } | ||
@@ -198,2 +203,8 @@ if (process.arch === 'ia32') { | ||
| } | ||
| if (process.arch === 'loong64') { | ||
| if (isMusl()) { | ||
| return 'linux-loong64-musl'; | ||
| } | ||
| return 'linux-loong64-gnu'; | ||
| } | ||
| if (process.arch === 'riscv64') { | ||
@@ -213,2 +224,14 @@ if (isMusl()) { | ||
| } | ||
| case 'openharmony': { | ||
| if (process.arch === 'arm64') { | ||
| return 'openharmony-arm64'; | ||
| } | ||
| if (process.arch === 'x64') { | ||
| return 'openharmony-x64'; | ||
| } | ||
| if (process.arch === 'arm') { | ||
| return 'openharmony-arm'; | ||
| } | ||
| break; | ||
| } | ||
| } | ||
@@ -215,0 +238,0 @@ return []; |
+7
-0
@@ -10,2 +10,3 @@ "use strict"; | ||
| armv7: 'arm', | ||
| loongarch64: 'loong64', | ||
| riscv64gc: 'riscv64', | ||
@@ -19,3 +20,5 @@ powerpc64le: 'ppc64', | ||
| windows: 'win32', | ||
| ohos: 'openharmony', | ||
| }; | ||
| const SUB_SYSTEMS = new Set(['android', 'ohos']); | ||
| function parseTriple(rawTriple) { | ||
@@ -48,2 +51,6 @@ if (rawTriple === constants_js_1.WASM32_WASI || | ||
| } | ||
| if (abi && SUB_SYSTEMS.has(abi)) { | ||
| sys = abi; | ||
| abi = null; | ||
| } | ||
| const platform = SysToNodePlatform[sys] ?? sys; | ||
@@ -50,0 +57,0 @@ const arch = CpuToNodeArch[cpu] ?? cpu; |
+1
-1
@@ -29,3 +29,3 @@ export interface Napi { | ||
| } | ||
| export type Platform = NodeJS.Platform | 'wasi' | 'wasm'; | ||
| export type Platform = NodeJS.Platform | 'openharmony' | 'wasi' | 'wasm'; | ||
| export type NodeJSArch = NodeJS.Architecture | 'universal' | 'wasm32' | 'x32'; | ||
@@ -32,0 +32,0 @@ export interface Target { |
+1
-1
| { | ||
| "name": "napi-postinstall", | ||
| "version": "0.3.3", | ||
| "version": "0.3.4", | ||
| "type": "commonjs", | ||
@@ -5,0 +5,0 @@ "description": "The `postinstall` script helper for handling native bindings in legacy `npm` versions", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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 2 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
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 2 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
59652
3.27%743
4.21%