Skip to content

Commit 030d506

Browse files
committed
fix: handle negative batch sizes
1 parent 66fb199 commit 030d506

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/it-batch/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ async function * batch (source, size = 1) {
1313
/** @type {T[]} */
1414
let things = []
1515

16+
if (size < 1) {
17+
size = 1
18+
}
19+
1620
for await (const thing of source) {
1721
things.push(thing)
1822

0 commit comments

Comments
 (0)