diff --git a/lib/DirectoryWatcher.js b/lib/DirectoryWatcher.js index 104f40a..1429283 100644 --- a/lib/DirectoryWatcher.js +++ b/lib/DirectoryWatcher.js @@ -626,7 +626,7 @@ class DirectoryWatcher extends EventEmitter { } }); for (const itemPath of itemPaths) { - const handleStats = (err2, stats) => { + fs.stat(itemPath, (err2, stats) => { if (this.closed) return; if (err2) { if ( @@ -653,12 +653,6 @@ class DirectoryWatcher extends EventEmitter { true, "scan (file)" ); - if ( - this.watcherManager.options.followSymlinks && - stats.isSymbolicLink() - ) { - fs.stat(itemPath, handleStats); - } } else if (stats.isDirectory()) { if (!initial || !this.directories.has(itemPath)) this.setDirectory( @@ -669,8 +663,7 @@ class DirectoryWatcher extends EventEmitter { ); } itemFinished(); - }; - fs.lstat(itemPath, handleStats); + }); } itemFinished(); });