Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: handle invalid files entry in package.json #1119

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/runtimes/node/utils/detect_native_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export const isNativeModule = ({
return true
}

const hasBinaryFile = files.some((path) => !path.startsWith('!') && extname(path) === '.node')
// Check if files is an array, as we never know (see https://github.com/math-utils/hamming-distance/pull/4)
const hasBinaryFile = Array.isArray(files)
? files.some((path) => !path.startsWith('!') && extname(path) === '.node')
: false

return hasBinaryFile
}