Skip to content

Commit

Permalink
use Array.from() instead of string.repeat()
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Sep 13, 2021
1 parent f206369 commit f9d171b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/kbn-std/src/iteration/test_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
* Side Public License, v 1.
*/

export const list = (size: number) =>
' '
.repeat(size)
.split('')
.filter(Boolean)
.map((_, i) => i);
export const list = (size: number) => Array.from({ length: size }, (_, i) => i);

export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));

Expand Down

0 comments on commit f9d171b

Please sign in to comment.