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'
99
1010var defaultIsFile = function isFile ( file ) {
1111 try {
12- var stat = fs . statSync ( file ) ;
12+ var stat = fs . statSync ( file , { throwIfNoEntry : false } ) ;
1313 } catch ( e ) {
1414 if ( e && ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) ) return false ;
1515 throw e ;
1616 }
17- return stat . isFile ( ) || stat . isFIFO ( ) ;
17+ return ! ! stat && ( stat . isFile ( ) || stat . isFIFO ( ) ) ;
1818} ;
1919
2020var defaultIsDir = function isDirectory ( dir ) {
2121 try {
22- var stat = fs . statSync ( dir ) ;
22+ var stat = fs . statSync ( dir , { throwIfNoEntry : false } ) ;
2323 } catch ( e ) {
2424 if ( e && ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) ) return false ;
2525 throw e ;
2626 }
27- return stat . isDirectory ( ) ;
27+ return ! ! stat && stat . isDirectory ( ) ;
2828} ;
2929
3030var defaultRealpathSync = function realpathSync ( x ) {
You can’t perform that action at this time.
0 commit comments