Skip to content

Commit b3fccf9

Browse files
committed
fix: dont cast ErrnoException
1 parent 90d9181 commit b3fccf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/util/exists.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ module.exports = function exists(filePath) {
5151
existsCaseSensitive(relativePath)
5252
} catch (error) {
5353
if (
54-
/** @type {NodeJS.ErrnoException} */ (error).code !== "ENOENT"
54+
error instanceof Error &&
55+
("code" in error === false || error.code !== "ENOENT")
5556
) {
5657
throw error
5758
}

0 commit comments

Comments
 (0)