Skip to content

Commit 28874fb

Browse files
mrodericktargos
authored andcommitted
fs: remove unnecessary ?? operator
This was introduced in 57678e5 With the `if` conditional around this statement, `options` will always be evaluated as truthy. That means that the nullish coalescing operator will always evaluate to the left side, make it unnecessary. PR-URL: #43073 Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]>
1 parent b659bab commit 28874fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/fs/promises.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
478478
offset = 0,
479479
length = buffer.byteLength - offset,
480480
position = null,
481-
} = offset ?? ObjectCreate(null));
481+
} = offset);
482482
}
483483

484484
if (offset == null) {

0 commit comments

Comments
 (0)