UNPKG

473 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function chunkd(array, index, total) {
4 let length = array.length;
5 let size = Math.floor(length / total);
6 let remainder = length % total;
7 let offset = Math.min(index, remainder) + index * size;
8 let chunk = size + (index < remainder ? 1 : 0);
9 return array.slice(offset, offset + chunk);
10}
11exports.default = chunkd;
12module.exports = chunkd;
13//# sourceMappingURL=chunkd.js.map
\No newline at end of file