Skip to content

Commit 491fa52

Browse files
committed
fixup! streams: remove unnecessary check
1 parent 4376b74 commit 491fa52

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/internal/webstreams/util.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ const AsyncIterator = {
5454

5555
function extractHighWaterMark(value, defaultHWM) {
5656
if (value === undefined) return defaultHWM;
57-
value = +value;
58-
if (typeof value !== 'number' ||
59-
NumberIsNaN(value) ||
60-
value < 0)
57+
const coercedValue = +value;
58+
if (NumberIsNaN(coercedValue) ||
59+
coercedValue < 0)
6160
throw new ERR_INVALID_ARG_VALUE.RangeError('strategy.highWaterMark', value);
62-
return value;
61+
return coercedValue;
6362
}
6463

6564
function extractSizeAlgorithm(size) {

0 commit comments

Comments
 (0)