lodev09/react-native-true-sheet

View on GitHub
example/src/utils/times.ts

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Invokes the iteratee n times, returning an array of the results of each invocation.
 * The iteratee is invoked with one argument; (index).
 */
export const times = <T>(length: number, iteratee: (index: number) => T): T[] =>
  Array.from<T, number>({ length }, (_, k) => k).map(iteratee)