Skip to content

Commit

Permalink
fix: resolve issue with duplicated chars
Browse files Browse the repository at this point in the history
  • Loading branch information
IamSebastianDev committed Dec 23, 2022
1 parent 3aadcfa commit 2853824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Db/ObjectId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class ObjectId {
}

private createUnique(): string {
const uniqueChars = chars.flatMap(this.convertToUppercase);
const uniqueChars = [...new Set(chars.flatMap(this.convertToUppercase))];
return Array.apply(null, Array(24))
.map(() => uniqueChars[this.getRandomCharIndex(uniqueChars.length)])
.join('');
Expand Down

0 comments on commit 2853824

Please sign in to comment.