We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ede9893 commit d112e36Copy full SHA for d112e36
src/index.ts
@@ -243,8 +243,10 @@ function removeQuerystring(id: string) {
243
244
const isFile = (path?: string | undefined): path is string => {
245
try {
246
- return !!path && fs.statSync(path).isFile()
+ if (!path) return false
247
+ return fs.statSync(path, { throwIfNoEntry: false })?.isFile() || false
248
} catch {
249
+ // Node 12 does not support throwIfNoEntry.
250
return false
251
}
252
0 commit comments