mirror of
https://github.com/vercel/commerce.git
synced 2025-06-09 09:36:58 +00:00
8 lines
165 B
TypeScript
8 lines
165 B
TypeScript
export default function rangeMap(n: number, fn: (i: number) => any) {
|
|
const arr = [];
|
|
while (n > arr.length) {
|
|
arr.push(fn(arr.length));
|
|
}
|
|
return arr;
|
|
}
|