Skip to content

Commit

Permalink
fs: refactor to use ES2020 syntax
Browse files Browse the repository at this point in the history
PR-URL: #41903
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
xtx1130 authored and danielleadams committed Apr 24, 2022
1 parent 6fc0a25 commit 2d16565
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ function realpathSync(p, options) {
}
resolvedLink = pathModule.resolve(previous, linkTarget);

if (cache) cache.set(base, resolvedLink);
cache?.set(base, resolvedLink);
if (!isWindows) seenLinks[id] = linkTarget;
}

Expand Down Expand Up @@ -3041,8 +3041,7 @@ ObjectDefineProperties(fs, {
configurable: true,
enumerable: true,
get() {
if (promises === null)
promises = require('internal/fs/promises').exports;
promises ??= require('internal/fs/promises').exports;
return promises;
}
}
Expand Down

0 comments on commit 2d16565

Please sign in to comment.