mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Filtered products for the landing
This commit is contained in:
7
lib/range-map.ts
Normal file
7
lib/range-map.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function rangeMap(n: number, fn: (i: number) => any) {
|
||||
const arr = []
|
||||
while (n > arr.length) {
|
||||
arr.push(fn(arr.length))
|
||||
}
|
||||
return arr
|
||||
}
|
Reference in New Issue
Block a user