mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-17 03:34:58 -04:00
fix: ensure length and count are > 0
This commit is contained in:
parent
bda56ac263
commit
aba466ac89
2 changed files with 6 additions and 4 deletions
|
@ -24,5 +24,6 @@ export function createToken({
|
|||
+ (withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : '')
|
||||
)).split('').filter(c => !(deniedChars?.includes(c))).join('');
|
||||
|
||||
return shuffleString(allAlphabet.repeat(length)).substring(0, length);
|
||||
const len = length < 1 ? 1 : length;
|
||||
return shuffleString(allAlphabet.repeat(len)).substring(0, len);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue