Skip to content
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
ronag committed Dec 27, 2021
commit a8e9dd6357d33e75a033a41f39aaebe97ca0ca7f
8 changes: 4 additions & 4 deletions lib/internal/streams/operators.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ const {
ERR_INVALID_ARG_VALUE,
}, AbortError,
Comment thread
ronag marked this conversation as resolved.
Outdated
} = require('internal/errors');
const {
validateInteger,
} = require('internal/validators');

const {
MathFloor,
NumberIsInteger,
Promise,
PromiseReject,
Symbol,
Expand All @@ -36,7 +34,9 @@ async function * map(fn, options) {
concurrency = MathFloor(options.concurrency);
}

validateInteger(concurrency, 'concurrency', 1);
if (!NumberIsInteger(concurrency)) {
Comment thread
ronag marked this conversation as resolved.
Outdated
Comment thread
aduh95 marked this conversation as resolved.
Outdated
throw new ERR_INVALID_ARG_TYPE('concurrency', ['Integer']);
}

if (concurrency < 1) {
throw new ERR_INVALID_ARG_VALUE('concurrency', concurrency);
Expand Down