forked from crowetic/commerce
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
|
||
|
}
|