Skip to content

Commit

Permalink
fix: handle invalid files entry in package.json (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jun 21, 2022
1 parent 04a68c8 commit dddd4f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtimes/node/utils/detect_native_module.ts
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
}

1 comment on commit dddd4f8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱ Benchmark results

largeDepsEsbuild: 5.6s

largeDepsNft: 27s

largeDepsZisi: 41.7s

Please sign in to comment.