Add types.js

This commit is contained in:
Christoph Diehl 2017-04-13 03:05:17 +03:00
parent 80e1a17cf6
commit db1db9b1a4
2 changed files with 21 additions and 0 deletions

View File

@ -28,4 +28,11 @@ make.strings = {
return s;
},
digitsHex: function (n) {
let s = '';
while (n-- > 0) {
s += (Random.number(16)).toString(16);
}
return s;
},
}

14
make/types.js Normal file
View File

@ -0,0 +1,14 @@
make.types = {
random: function() {
return random.item([
"true",
"null",
"(new Object())",
"undefined",
"{}",
"[]",
"''",
"function() {}"
]);
}
}