Skip to content

Commit 2d16565

Browse files
xtx1130danielleadams
authored andcommitted
fs: refactor to use ES2020 syntax
PR-URL: #41903 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 6fc0a25 commit 2d16565

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/fs.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ function realpathSync(p, options) {
25162516
}
25172517
resolvedLink = pathModule.resolve(previous, linkTarget);
25182518

2519-
if (cache) cache.set(base, resolvedLink);
2519+
cache?.set(base, resolvedLink);
25202520
if (!isWindows) seenLinks[id] = linkTarget;
25212521
}
25222522

@@ -3041,8 +3041,7 @@ ObjectDefineProperties(fs, {
30413041
configurable: true,
30423042
enumerable: true,
30433043
get() {
3044-
if (promises === null)
3045-
promises = require('internal/fs/promises').exports;
3044+
promises ??= require('internal/fs/promises').exports;
30463045
return promises;
30473046
}
30483047
}

0 commit comments

Comments
 (0)