Files
bonob/src/utils.ts
2021-08-30 11:51:22 +10:00

7 lines
185 B
TypeScript

export function takeWithRepeats<T>(things:T[], count: number) {
const result = [];
for(let i = 0; i < count; i++) {
result.push(things[i % things.length])
}
return result;
}