batchs -> batches

master
mjkhan21 5 months ago
parent b0e9421834
commit bccb777d25

@ -136,17 +136,17 @@ function getBatches(array, keymapper, size = 50) {
return result; return result;
}, {}), }, {}),
batch = [], batch = [],
batchs = []; batches = [];
for (let items of Object.values(byKey)) { for (let items of Object.values(byKey)) {
batch = batch.concat(items); batch = batch.concat(items);
if (batch.length < size) continue; if (batch.length < size) continue;
batchs.push([].concat(batch)); batches.push([].concat(batch));
batch.splice(0); batch.splice(0);
} }
if (batch.length > 0) if (batch.length > 0)
batchs.push(batch); batches.push(batch);
return batchs; return batches;
} }
function upload(options) { function upload(options) {

Loading…
Cancel
Save