Skip to content

The open alternative to Salesforce, designed for AI.

219 B
Raw Blame
export const arrayToChunks = <T>(array: T[], size: number) => {
  const arrayCopy = [...array];
  const results = [];

  while (arrayCopy.length) {
    results.push(arrayCopy.splice(0, size));
  }

  return results;
};