We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fa38fb commit 5f7e874Copy full SHA for 5f7e874
src/random.ts
@@ -557,16 +557,9 @@ export class Random {
557
558
const { allowLeadingZeros = false, bannedDigits = [] } = options;
559
560
- const joinedBannedDigits =
561
- bannedDigits.length > 0
562
- ? Array.from(new Set([...bannedDigits]))
563
- .filter((char) => /^[0-9]$/.test(char))
564
- .join('')
565
- : '';
566
-
567
const allowedDigits = '0123456789'
568
.split('')
569
- .filter((digit) => !joinedBannedDigits.includes(digit));
+ .filter((digit) => !bannedDigits.includes(digit));
570
571
if (
572
allowedDigits.length === 0 ||
0 commit comments