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 Feb 11, 2022
1 parent 0185464 commit 08938a1
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 @@ -2515,7 +2515,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 @@ -3040,8 +3040,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 08938a1

Please sign in to comment.