openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
11 lines (10 loc) • 342 B
JavaScript
//#region src/utils/chunk-items.ts
/** Splits items into fixed-size chunks, preserving order and returning one row for non-positive sizes. */
function chunkItems(e, t) {
if (t <= 0) return [Array.from(e)];
const n = [];
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
return n;
}
//#endregion
export { chunkItems as t };