chunks

tcmts.cli.sync.chunks · #d66rgpr3 · term · runs anywhere

xs in slices of n, so no request grows without bound.

export const chunks = <T>(xs: T[], n = 500): T[][] => Array.from({ length: Math.ceil(xs.length / n) }, (_, i) => xs.slice(i * n, i * n + n))

used by