mfussenegger/mkjson

Add support for random strings

seut opened this issue · 1 comments

seut commented

Currently, only generating a random character is supported by the randomChar() method. While this can be combined with replicate() to generate an array of characters, I could not find a way to generate a string.

It would be great to have a way to generate a random string, at best with options to control min, max and concrete number of characters.

seut commented

@mfussenegger pointed me to use fromRegex() instead, e.g. fromRegex('[a-z]{10}').
This works for me, so I'm closing this.