From db1db9b1a478829e753694ee1aaae0dd97d0ddb4 Mon Sep 17 00:00:00 2001 From: Christoph Diehl Date: Thu, 13 Apr 2017 03:05:17 +0300 Subject: [PATCH] Add types.js --- make/strings.js | 7 +++++++ make/types.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 make/types.js diff --git a/make/strings.js b/make/strings.js index d027427..dfcdff5 100644 --- a/make/strings.js +++ b/make/strings.js @@ -28,4 +28,11 @@ make.strings = { return s; }, + digitsHex: function (n) { + let s = ''; + while (n-- > 0) { + s += (Random.number(16)).toString(16); + } + return s; + }, } diff --git a/make/types.js b/make/types.js new file mode 100644 index 0000000..6e2c2bf --- /dev/null +++ b/make/types.js @@ -0,0 +1,14 @@ +make.types = { + random: function() { + return random.item([ + "true", + "null", + "(new Object())", + "undefined", + "{}", + "[]", + "''", + "function() {}" + ]); + } +}