Skip to content

Commit 5f7e874

Browse files
committed
chore: remove pre-optimization
1 parent 6fa38fb commit 5f7e874

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/random.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,16 +557,9 @@ export class Random {
557557

558558
const { allowLeadingZeros = false, bannedDigits = [] } = options;
559559

560-
const joinedBannedDigits =
561-
bannedDigits.length > 0
562-
? Array.from(new Set([...bannedDigits]))
563-
.filter((char) => /^[0-9]$/.test(char))
564-
.join('')
565-
: '';
566-
567560
const allowedDigits = '0123456789'
568561
.split('')
569-
.filter((digit) => !joinedBannedDigits.includes(digit));
562+
.filter((digit) => !bannedDigits.includes(digit));
570563

571564
if (
572565
allowedDigits.length === 0 ||

0 commit comments

Comments
 (0)