File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,22 @@ var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function'
9
9
10
10
var defaultIsFile = function isFile ( file ) {
11
11
try {
12
- var stat = fs . statSync ( file ) ;
12
+ var stat = fs . statSync ( file , { throwIfNoEntry : false } ) ;
13
13
} catch ( e ) {
14
14
if ( e && ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) ) return false ;
15
15
throw e ;
16
16
}
17
- return stat . isFile ( ) || stat . isFIFO ( ) ;
17
+ return ! ! stat && ( stat . isFile ( ) || stat . isFIFO ( ) ) ;
18
18
} ;
19
19
20
20
var defaultIsDir = function isDirectory ( dir ) {
21
21
try {
22
- var stat = fs . statSync ( dir ) ;
22
+ var stat = fs . statSync ( dir , { throwIfNoEntry : false } ) ;
23
23
} catch ( e ) {
24
24
if ( e && ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) ) return false ;
25
25
throw e ;
26
26
}
27
- return stat . isDirectory ( ) ;
27
+ return ! ! stat && stat . isDirectory ( ) ;
28
28
} ;
29
29
30
30
var defaultRealpathSync = function realpathSync ( x ) {
You can’t perform that action at this time.
0 commit comments