Skip to content

Commit

Permalink
Use throwIfNoEntry if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Molinaro authored Oct 28, 2021
1 parent 27b89ec commit 1d95a4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/jest-resolve/src/fileWalkers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function statSyncCached(path: string): IPathType {

let stat;
try {
stat = fs.statSync(path);
// @ts-expect-error TS2554 - throwIfNoEntry is not available in recent version of node, but inclusion of the option is a backward compatible no-op.
stat = fs.statSync(path, {throwIfNoEntry: false});
} catch (e: any) {
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
throw e;
Expand Down

0 comments on commit 1d95a4b

Please sign in to comment.