File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ var nodeModulesPaths = require('./node-modules-paths.js');
55var normalizeOptions = require ( './normalize-options.js' ) ;
66var isCore = require ( './is-core' ) ;
77
8+ var realpath = typeof fs . realpath . native === 'function' ? fs . realpath . native : fs . realpath ;
9+
810var defaultIsFile = function isFile ( file , cb ) {
911 fs . stat ( file , function ( err , stat ) {
1012 if ( ! err ) {
@@ -27,7 +29,7 @@ var defaultIsDir = function isDirectory(dir, cb) {
2729
2830var maybeUnwrapSymlink = function maybeUnwrapSymlink ( x , opts , cb ) {
2931 if ( ! opts || ! opts . preserveSymlinks ) {
30- fs . realpath ( x , function ( realPathErr , realPath ) {
32+ realpath ( x , function ( realPathErr , realPath ) {
3133 if ( realPathErr && realPathErr . code !== 'ENOENT' ) cb ( realPathErr ) ;
3234 else cb ( null , realPathErr ? x : realPath ) ;
3335 } ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ var caller = require('./caller.js');
55var nodeModulesPaths = require ( './node-modules-paths.js' ) ;
66var normalizeOptions = require ( './normalize-options.js' ) ;
77
8+ var realpath = typeof fs . realpathSync . native === 'function' ? fs . realpathSync . native : fs . realpathSync ;
9+
810var defaultIsFile = function isFile ( file ) {
911 try {
1012 var stat = fs . statSync ( file ) ;
@@ -28,7 +30,7 @@ var defaultIsDir = function isDirectory(dir) {
2830var maybeUnwrapSymlink = function maybeUnwrapSymlink ( x , opts ) {
2931 if ( ! opts || ! opts . preserveSymlinks ) {
3032 try {
31- return fs . realpathSync ( x ) ;
33+ return realpath ( x ) ;
3234 } catch ( realPathErr ) {
3335 if ( realPathErr . code !== 'ENOENT' ) {
3436 throw realPathErr ;
You can’t perform that action at this time.
0 commit comments