background-process-js
Version:
A set of util tools for create background process.
14 lines (13 loc) • 436 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitArrayInChunks = void 0;
const splitArrayInChunks = (array, size) => {
if (size <= 0)
throw new Error("Size must be greater than zero");
const result = [];
for (let i = 0; i < array.length; i += size) {
result.push(array.slice(i, i + size));
}
return result;
};
exports.splitArrayInChunks = splitArrayInChunks;
;