How to use the character function from chance
Find comprehensive JavaScript chance.character code examples handpicked from public code repositorys.
53 54 55 56 57 58 59 60 61 62
/** * By default it will return a string with random character from the specified pool. * @param {string} pool */ char(pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_') { return chance.character({ pool }); }, /** * Return a random string. By default it will return a string with random length of 5-20 characters
5
0
1
+ 3 other calls in file
GitHub: sylvainv/pg-manati
98 99 100 101 102 103 104 105 106 107
async.series([ function (cb) { test.app.post('/data/string_data') .set('Content-Type', 'application/json') .send(data = { 'char_short': chance.character(), 'char_long': chance.word({length: 5}), 'string_short': chance.character(), 'string_long': chance.word({length: 5}), 'string': chance.paragraph({sentences: 5}),
2
5
4
+ 3 other calls in file
74 75 76 77 78 79 80 81 82
break; case 'ccnumber': s += chance.cc().toCsv(CSV.delimiter); break; case 'char': // one character s += chance.character(); break; case 'date': n = hdr[k].arg;
2
8
0
+ 3 other calls in file
chance.word is the most popular function in chance (344 examples)