Thanks to visit codestin.com Credit goes to github.com
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 1d288a6 commit d2e58e3Copy full SHA for d2e58e3
lib/internal/fs/glob.js
@@ -65,15 +65,13 @@ async function getDirent(path) {
65
* @returns {DirentFromStats|null}
66
*/
67
function getDirentSync(path) {
68
+ let stat;
69
try {
- const stat = lstatSync(path, { throwIfNoEntry: false });
70
- if (stat === undefined) {
71
- return null;
72
- }
73
- return new DirentFromStats(basename(path), stat, dirname(path));
+ stat = lstatSync(path);
74
} catch {
75
return null;
76
}
+ return new DirentFromStats(basename(path), stat, dirname(path));
77
78
79
/**
0 commit comments