1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-31 22:11:24 +00:00
Files
.vscode
framework
packages
site
assets
components
config
lib
api
click-outside
hooks
colors.ts
focus-trap.tsx
get-slug.ts
range-map.ts
search-props.tsx
search.tsx
to-pixels.ts
usage-warns.ts
pages
public
.env.template
.eslintrc
.gitignore
.prettierignore
.prettierrc
codegen.bigcommerce.json
codegen.json
commerce-config.js
commerce.config.json
global.d.ts
next-env.d.ts
next.config.js
package.json
postcss.config.js
swell-js.d.ts
tailwind.config.js
tsconfig.json
.editorconfig
.gitignore
.prettierignore
.prettierrc
README.md
license.md
package-copy.json
package-lock.json
package.json
commerce/site/lib/range-map.ts
2022-01-07 11:48:45 -05:00

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
}