Skip to content

Commit 419fb0f

Browse files
committed
fix: allow empty fields
1 parent c449fa5 commit 419fb0f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

build/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24631,9 +24631,9 @@ function getDependenciesFromPackageJson(pkg, types) {
2463124631
return result;
2463224632
}
2463324633
function isSupportedArchitecture(pkg, os, cpu, libc) {
24634-
const osMatches = pkg.os === void 0 || pkg.os.length > 0 && pkg.os.includes(os);
24635-
const cpuMatches = pkg.cpu === void 0 || pkg.cpu.length > 0 && pkg.cpu.includes(cpu);
24636-
const libcMatches = pkg.libc === void 0 || pkg.libc.length > 0 && pkg.libc.includes(libc);
24634+
const osMatches = pkg.os === void 0 || pkg.os.length === 0 || pkg.os.includes(os);
24635+
const cpuMatches = pkg.cpu === void 0 || pkg.cpu.length === 0 || pkg.cpu.includes(cpu);
24636+
const libcMatches = pkg.libc === void 0 || pkg.libc.length === 0 || pkg.libc.includes(libc);
2463724637
return osMatches && cpuMatches && libcMatches;
2463824638
}
2463924639

src/npm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ export function isSupportedArchitecture(
229229
libc: string
230230
): boolean {
231231
const osMatches =
232-
pkg.os === undefined || (pkg.os.length > 0 && pkg.os.includes(os));
232+
pkg.os === undefined || pkg.os.length === 0 || pkg.os.includes(os);
233233
const cpuMatches =
234-
pkg.cpu === undefined || (pkg.cpu.length > 0 && pkg.cpu.includes(cpu));
234+
pkg.cpu === undefined || pkg.cpu.length === 0 || pkg.cpu.includes(cpu);
235235
const libcMatches =
236-
pkg.libc === undefined || (pkg.libc.length > 0 && pkg.libc.includes(libc));
236+
pkg.libc === undefined || pkg.libc.length === 0 || pkg.libc.includes(libc);
237237
return osMatches && cpuMatches && libcMatches;
238238
}

0 commit comments

Comments
 (0)