Skip to content

Commit

Permalink
style: optimize generateMultiple method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 12, 2022
1 parent 3e4d8ff commit 08ccebb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export function generate(opts: Option = {}) {
/** Create a random set of passwords */
export function generateMultiple(length: number = 10, opts?: Option) {
const result: string[] = [];
[...Array(length)].forEach(() => result.push(generate(opts)));
for (let i = 0; i < length; i++) {
result.push(generate(opts));
}
return result;
}

Expand Down

0 comments on commit 08ccebb

Please sign in to comment.