feat: redis-based external imports

This commit is contained in:
Daniel Hougaard
2024-10-11 11:15:56 +04:00
parent 09d28156f8
commit 162005d72f
14 changed files with 338 additions and 110 deletions
+11
View File
@@ -70,3 +70,14 @@ export const objectify = <T, Key extends string | number | symbol, Value = T>(
{} as Record<Key, Value>
);
};
/**
* Chunks an array into smaller arrays of the given size.
*/
export const chunkArray = <T>(array: T[], chunkSize: number): T[][] => {
const chunks: T[][] = [];
for (let i = 0; i < array.length; i += chunkSize) {
chunks.push(array.slice(i, i + chunkSize));
}
return chunks;
};