Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,9 @@ function statSync(path, options = { __proto__: null, bigint: false, throwIfNoEnt
const result = h.statSync(path, options);
if (result !== undefined) return result;
} catch (err) {
if (err?.code === 'ENOENT' && options?.throwIfNoEntry === false) return undefined;
// As in the binding, ENOTDIR also means there is no such entry.
if (options?.throwIfNoEntry === false &&
(err?.code === 'ENOENT' || err?.code === 'ENOTDIR')) return undefined;
throw err;
}
}
Expand Down
Loading
Loading