From daeabf20cdce599aa9569804dc71bc61895449e5 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 26 Nov 2019 11:29:27 +0000 Subject: [PATCH] default size to 1 --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 7ebf78a..426ce0c 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,10 @@ const batch = require('it-batch') async function * parallelBatch (source, size) { + if (isNaN(size)) { + size = 1 + } + for await (const things of batch(source, size)) { const results = [] let nextResultIndex = 0