Return a random string / array of strings.
0.1.0
piupiu.RandomString: MockFactory<String>
(string)
: Returns a random string.
(string[])
: Returns anArray
of random string.
piupiu.RandomString.getOne();
// 'e23sDwe'
piupiu.RandomString.getOne({
options: {
min: 10
}
});
// 'Df3dunWQ343E'
piupiu.RandomString.getOne({
options: {
max: 5
}
});
// 'oke'
piupiu.RandomString.getOne({
options: {
min:2,
max: 5
}
});
// 'dE4d'
piupiu.RandomString.getArray();
// ['e23sDwe', 'eineE3']
piupiu.RandomString.getArray({
length: 3
});
// ['e23sDwe', 'eineE3', 'ei']
piupiu.RandomString.getArray({
length: 2,
options: {
min: 10
}
});
// ['Df3dunWQ343E', 'eDer3dgE2e']