w3tecch / typeorm-seeding

🌱 A delightful way to seed test data into your database.
https://www.npmjs.com/package/typeorm-seeding
MIT License
887 stars 132 forks source link

Remove times function #186

Closed jorgebodega closed 2 years ago

jorgebodega commented 2 years ago

There is a file called helpers with a function called times. Basically, times is a useless function in this context, is a map but instead of iterates over an array, iterates n-times.

And because this function is not used anymore on this library, should not be here.

Alternatives:

[...Array(times)].map(() => {
    return function(...args);
})
let times: number
let arr: any = []
for (let i = 0; i < times; i++) {
    arr.push(function(...args));
}