function getRandomString(length, options) {
const params = {
numeric: get(options, 'numeric', true),
letters: get(options, 'letters', true),
special: get(options, 'special', true),
exclude: get(options, 'exclude', []),
};
return randomString({
length,
...params,
});
}
......
Can see the function detail as above, I have only set the options as non-mandatory params, if no options passed here, all options will be true, but what I got the string have no at least one number...not always like this, but sometimes can not works.