mirror of
https://github.com/vercel/commerce.git
synced 2025-03-15 15:02:32 +00:00
8 lines
162 B
TypeScript
8 lines
162 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
|
|
}
|