Closed kivlor closed 6 years ago
@kivlor thanks! Looks good. I just had one syntax comment, then it looks good to me.
From #12:
I wasn't sure the best approach to take to allow passing a function
I think this means to check if exclude
is a function just before checking for string
or array
and calling exclude
passing in the current mask
.
At first, I thought it meant taking a function that allowed returning the mask
, but that can be done by passing a string on options.chars
.
I think with this change, a scenario that I thought of will be addressed: I want a random string that contains most of the characters provided here (all - some excluded chars) + some chars that aren't included.
const id = randomatic('?*', 20, { chars: '|', exclude: ['1lL0oO.'] });
@doowb syntax comment addressed!
Thanks for explaining my 'passing a function' question. Seems with out it this change will still work (and without the complexity).
Thanks @kivlor this has been merged and published as 3.1.0
.
Fixes #12