File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/tools/token-generator Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ export function createToken({
17
17
length ?: number
18
18
alphabet ?: string
19
19
} ) {
20
- const allAlphabet = alphabet ?? [
21
- withUppercase ? 'ABCDEFGHIJKLMOPQRSTUVWXYZ' : '' ,
22
- withLowercase ? 'abcdefghijklmopqrstuvwxyz' : '' ,
23
- withNumbers ? '0123456789' : '' ,
24
- withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : '' ,
25
- ] . filter ( c => ! ( deniedChars ?. includes ( c ) ) ) . join ( '' ) ; ;
20
+ const allAlphabet = ( alphabet ?? (
21
+ ( withUppercase ? 'ABCDEFGHIJKLMOPQRSTUVWXYZ' : '' )
22
+ + ( withLowercase ? 'abcdefghijklmopqrstuvwxyz' : '' )
23
+ + ( withNumbers ? '0123456789' : '' )
24
+ + ( withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : '' )
25
+ ) ) . split ( '' ) . filter ( c => ! ( deniedChars ?. includes ( c ) ) ) . join ( '' ) ;
26
26
27
27
return shuffleString ( allAlphabet . repeat ( length ) ) . substring ( 0 , length ) ;
28
28
}
You can’t perform that action at this time.
0 commit comments