Skip to content

Commit 6629f8f

Browse files
yallopevanlucas
authored andcommitted
fs: cache non-symlinks in realpathSync.
Extend `fs.realpathSync` to cache the results for paths that are not symlinks in addition to caching symlink mappings. PR-URL: #10253 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 10b3297 commit 6629f8f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/fs.js

+1
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,7 @@ fs.realpathSync = function realpathSync(p, options) {
15321532
var stat = fs.lstatSync(base);
15331533
if (!stat.isSymbolicLink()) {
15341534
knownHard[base] = true;
1535+
if (cache) cache.set(base, base);
15351536
continue;
15361537
}
15371538

0 commit comments

Comments
 (0)