diginext-utils 2.0.6 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/Checker.d.ts +5 -0
  2. package/dist/Checker.js +30 -0
  3. package/dist/Checker.js.map +1 -0
  4. package/dist/EventDispatcher.d.ts +11 -0
  5. package/dist/EventDispatcher.js +51 -0
  6. package/dist/EventDispatcher.js.map +1 -0
  7. package/dist/FileUpload.d.ts +11 -0
  8. package/dist/FileUpload.js +64 -0
  9. package/dist/FileUpload.js.map +1 -0
  10. package/dist/Slug.d.ts +4 -0
  11. package/dist/Slug.js +332 -0
  12. package/dist/Slug.js.map +1 -0
  13. package/dist/Timer.d.ts +3 -0
  14. package/dist/Timer.js +9 -0
  15. package/dist/Timer.js.map +1 -0
  16. package/dist/Validation.d.ts +4 -0
  17. package/dist/Validation.js +39 -0
  18. package/dist/Validation.js.map +1 -0
  19. package/dist/array.d.ts +91 -0
  20. package/dist/array.js +275 -0
  21. package/dist/array.js.map +1 -0
  22. package/dist/color.d.ts +10 -0
  23. package/dist/color.js +86 -0
  24. package/dist/color.js.map +1 -0
  25. package/dist/console/enableConsole.d.ts +1 -3
  26. package/dist/console/enableConsole.js +10 -14
  27. package/dist/console/enableConsole.js.map +1 -0
  28. package/dist/console/index.d.ts +3 -5
  29. package/dist/console/index.js +12 -16
  30. package/dist/console/index.js.map +1 -0
  31. package/dist/device/browser.d.ts +5 -7
  32. package/dist/device/browser.js +32 -34
  33. package/dist/device/browser.js.map +1 -0
  34. package/dist/device/camera.d.ts +7 -16
  35. package/dist/device/camera.js +166 -157
  36. package/dist/device/camera.js.map +1 -0
  37. package/dist/device.d.ts +4 -0
  38. package/dist/device.js +217 -0
  39. package/dist/device.js.map +1 -0
  40. package/dist/file/createDir.d.ts +1 -2
  41. package/dist/file/createDir.js +13 -20
  42. package/dist/file/createDir.js.map +1 -0
  43. package/dist/file/fileMove.d.ts +1 -3
  44. package/dist/file/fileMove.js +29 -35
  45. package/dist/file/fileMove.js.map +1 -0
  46. package/dist/file/findFilesByExt.d.ts +0 -1
  47. package/dist/file/findFilesByExt.js +41 -46
  48. package/dist/file/findFilesByExt.js.map +1 -0
  49. package/dist/index.d.ts +16 -0
  50. package/dist/index.js +33 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/math/diffDate.d.ts +1 -3
  53. package/dist/math/diffDate.js +10 -9
  54. package/dist/math/diffDate.js.map +1 -0
  55. package/dist/math/index.d.ts +8 -10
  56. package/dist/math/index.js +92 -48
  57. package/dist/math/index.js.map +1 -0
  58. package/dist/math/positiveNumber.d.ts +1 -3
  59. package/dist/math/positiveNumber.js +13 -27
  60. package/dist/math/positiveNumber.js.map +1 -0
  61. package/dist/name/en.d.ts +1 -3
  62. package/dist/name/en.js +17 -12
  63. package/dist/name/en.js.map +1 -0
  64. package/dist/name/vi.d.ts +1 -3
  65. package/dist/name/vi.js +23 -34
  66. package/dist/name/vi.js.map +1 -0
  67. package/dist/object.d.ts +23 -0
  68. package/dist/object.js +57 -0
  69. package/dist/object.js.map +1 -0
  70. package/dist/permission/requestCamera.d.ts +2 -3
  71. package/dist/permission/requestCamera.js +37 -25
  72. package/dist/permission/requestCamera.js.map +1 -0
  73. package/dist/permission/requestDeviceOrientationControl.d.ts +0 -1
  74. package/dist/permission/requestDeviceOrientationControl.js +35 -174
  75. package/dist/permission/requestDeviceOrientationControl.js.map +1 -0
  76. package/dist/string/formatNumber.d.ts +1 -3
  77. package/dist/string/formatNumber.js +11 -27
  78. package/dist/string/formatNumber.js.map +1 -0
  79. package/dist/string/generatePassword.d.ts +1 -3
  80. package/dist/string/generatePassword.js +20 -26
  81. package/dist/string/generatePassword.js.map +1 -0
  82. package/dist/string/generateUUID.d.ts +1 -3
  83. package/dist/string/generateUUID.js +33 -13
  84. package/dist/string/generateUUID.js.map +1 -0
  85. package/dist/string/index.d.ts +8 -10
  86. package/dist/string/index.js +118 -96
  87. package/dist/string/index.js.map +1 -0
  88. package/dist/string/random.d.ts +6 -8
  89. package/dist/string/random.js +20 -23
  90. package/dist/string/random.js.map +1 -0
  91. package/dist/string/trimNull.d.ts +1 -3
  92. package/dist/string/trimNull.js +15 -19
  93. package/dist/string/trimNull.js.map +1 -0
  94. package/dist/string/url.d.ts +7 -14
  95. package/dist/string/url.js +92 -77
  96. package/dist/string/url.js.map +1 -0
  97. package/esm/Checker.d.ts +5 -0
  98. package/esm/Checker.js +27 -0
  99. package/esm/Checker.js.map +1 -0
  100. package/esm/EventDispatcher.d.ts +11 -0
  101. package/esm/EventDispatcher.js +47 -0
  102. package/esm/EventDispatcher.js.map +1 -0
  103. package/esm/FileUpload.d.ts +11 -0
  104. package/esm/FileUpload.js +61 -0
  105. package/esm/FileUpload.js.map +1 -0
  106. package/esm/Slug.d.ts +4 -0
  107. package/esm/Slug.js +329 -0
  108. package/esm/Slug.js.map +1 -0
  109. package/esm/Timer.d.ts +3 -0
  110. package/esm/Timer.js +6 -0
  111. package/esm/Timer.js.map +1 -0
  112. package/esm/Validation.d.ts +4 -0
  113. package/esm/Validation.js +36 -0
  114. package/esm/Validation.js.map +1 -0
  115. package/esm/array.d.ts +91 -0
  116. package/esm/array.js +253 -0
  117. package/esm/array.js.map +1 -0
  118. package/esm/color.d.ts +10 -0
  119. package/esm/color.js +77 -0
  120. package/esm/color.js.map +1 -0
  121. package/esm/console/enableConsole.d.ts +1 -0
  122. package/esm/console/enableConsole.js +6 -0
  123. package/esm/console/enableConsole.js.map +1 -0
  124. package/esm/console/index.d.ts +3 -0
  125. package/esm/console/index.js +10 -0
  126. package/esm/console/index.js.map +1 -0
  127. package/esm/device/browser.d.ts +5 -0
  128. package/esm/device/browser.js +30 -0
  129. package/esm/device/browser.js.map +1 -0
  130. package/esm/device/camera.d.ts +7 -0
  131. package/esm/device/camera.js +168 -0
  132. package/esm/device/camera.js.map +1 -0
  133. package/esm/device.d.ts +4 -0
  134. package/esm/device.js +210 -0
  135. package/esm/device.js.map +1 -0
  136. package/esm/file/createDir.d.ts +5 -0
  137. package/esm/file/createDir.js +13 -0
  138. package/esm/file/createDir.js.map +1 -0
  139. package/esm/file/fileMove.d.ts +4 -0
  140. package/esm/file/fileMove.js +29 -0
  141. package/esm/file/fileMove.js.map +1 -0
  142. package/esm/file/findFilesByExt.d.ts +5 -0
  143. package/esm/file/findFilesByExt.js +41 -0
  144. package/esm/file/findFilesByExt.js.map +1 -0
  145. package/esm/index.d.ts +16 -0
  146. package/esm/index.js +17 -0
  147. package/esm/index.js.map +1 -0
  148. package/esm/math/diffDate.d.ts +4 -0
  149. package/esm/math/diffDate.js +9 -0
  150. package/esm/math/diffDate.js.map +1 -0
  151. package/esm/math/index.d.ts +53 -0
  152. package/esm/math/index.js +84 -0
  153. package/esm/math/index.js.map +1 -0
  154. package/esm/math/positiveNumber.d.ts +1 -0
  155. package/esm/math/positiveNumber.js +12 -0
  156. package/esm/math/positiveNumber.js.map +1 -0
  157. package/esm/name/en.d.ts +1 -0
  158. package/esm/name/en.js +20 -0
  159. package/esm/name/en.js.map +1 -0
  160. package/esm/name/vi.d.ts +1 -0
  161. package/esm/name/vi.js +22 -0
  162. package/esm/name/vi.js.map +1 -0
  163. package/esm/object.d.ts +23 -0
  164. package/esm/object.js +48 -0
  165. package/esm/object.js.map +1 -0
  166. package/esm/permission/requestCamera.d.ts +5 -0
  167. package/esm/permission/requestCamera.js +39 -0
  168. package/esm/permission/requestCamera.js.map +1 -0
  169. package/esm/permission/requestDeviceOrientationControl.d.ts +2 -0
  170. package/esm/permission/requestDeviceOrientationControl.js +35 -0
  171. package/esm/permission/requestDeviceOrientationControl.js.map +1 -0
  172. package/esm/string/formatNumber.d.ts +5 -0
  173. package/esm/string/formatNumber.js +10 -0
  174. package/esm/string/formatNumber.js.map +1 -0
  175. package/esm/string/generatePassword.d.ts +8 -0
  176. package/esm/string/generatePassword.js +19 -0
  177. package/esm/string/generatePassword.js.map +1 -0
  178. package/esm/string/generateUUID.d.ts +1 -0
  179. package/esm/string/generateUUID.js +32 -0
  180. package/esm/string/generateUUID.js.map +1 -0
  181. package/esm/string/index.d.ts +33 -0
  182. package/esm/string/index.js +118 -0
  183. package/esm/string/index.js.map +1 -0
  184. package/esm/string/random.d.ts +9 -0
  185. package/esm/string/random.js +18 -0
  186. package/esm/string/random.js.map +1 -0
  187. package/esm/string/trimNull.d.ts +1 -0
  188. package/esm/string/trimNull.js +11 -0
  189. package/esm/string/trimNull.js.map +1 -0
  190. package/esm/string/url.d.ts +26 -0
  191. package/esm/string/url.js +94 -0
  192. package/esm/string/url.js.map +1 -0
  193. package/package.json +7 -8
  194. package/src/Checker.ts +27 -0
  195. package/src/EventDispatcher.ts +60 -0
  196. package/src/FileUpload.ts +65 -0
  197. package/src/Slug.ts +364 -0
  198. package/src/Timer.ts +5 -0
  199. package/src/Validation.ts +35 -0
  200. package/src/array.ts +261 -0
  201. package/src/color.ts +89 -0
  202. package/src/console/enableConsole.ts +6 -0
  203. package/src/console/index.ts +11 -0
  204. package/src/device/browser.ts +29 -0
  205. package/src/device/camera.ts +209 -0
  206. package/src/device.ts +223 -0
  207. package/src/file/createDir.ts +14 -0
  208. package/src/file/fileMove.ts +32 -0
  209. package/src/file/findFilesByExt.ts +39 -0
  210. package/src/index.ts +17 -0
  211. package/src/math/diffDate.ts +8 -0
  212. package/src/math/index.ts +88 -0
  213. package/src/math/positiveNumber.ts +10 -0
  214. package/src/name/en.ts +24 -0
  215. package/src/name/vi.ts +21 -0
  216. package/src/object.ts +49 -0
  217. package/src/permission/requestCamera.ts +43 -0
  218. package/src/permission/requestDeviceOrientationControl.ts +33 -0
  219. package/src/string/formatNumber.ts +10 -0
  220. package/src/string/generatePassword.ts +16 -0
  221. package/src/string/generateUUID.ts +35 -0
  222. package/src/string/index.ts +145 -0
  223. package/src/string/random.ts +20 -0
  224. package/src/string/trimNull.ts +11 -0
  225. package/src/string/url.ts +109 -0
  226. package/dist/esm/chunk-5HIQS7HE.js +0 -40
  227. package/dist/esm/chunk-EZUCZHGV.js +0 -9
  228. package/dist/esm/chunk-HDM7KM5F.js +0 -20
  229. package/dist/esm/chunk-LNLCKCWC.js +0 -17
  230. package/dist/esm/chunk-X3K4KC75.js +0 -26
  231. package/dist/esm/console/enableConsole.js +0 -9
  232. package/dist/esm/console/index.js +0 -15
  233. package/dist/esm/device/browser.js +0 -34
  234. package/dist/esm/device/camera.js +0 -137
  235. package/dist/esm/file/createDir.js +0 -13
  236. package/dist/esm/file/fileMove.js +0 -29
  237. package/dist/esm/file/findFilesByExt.js +0 -39
  238. package/dist/esm/math/diffDate.js +0 -10
  239. package/dist/esm/math/index.js +0 -2
  240. package/dist/esm/math/positiveNumber.js +0 -16
  241. package/dist/esm/name/en.js +0 -17
  242. package/dist/esm/name/vi.js +0 -31
  243. package/dist/esm/permission/requestCamera.js +0 -2
  244. package/dist/esm/permission/requestDeviceOrientationControl.js +0 -175
  245. package/dist/esm/string/formatNumber.js +0 -10
  246. package/dist/esm/string/generatePassword.js +0 -16
  247. package/dist/esm/string/generateUUID.js +0 -14
  248. package/dist/esm/string/index.js +0 -86
  249. package/dist/esm/string/random.js +0 -2
  250. package/dist/esm/string/trimNull.js +0 -14
  251. package/dist/esm/string/url.js +0 -69
package/src/device.ts ADDED
@@ -0,0 +1,223 @@
1
+ export const isIos = () => {
2
+ const deviceInfo = checkOS();
3
+ if (deviceInfo) return deviceInfo.os.toLowerCase() == "ios";
4
+ console.log("Can't check OS");
5
+ return null;
6
+ };
7
+
8
+ export const isAndroid = () => {
9
+ const deviceInfo = checkOS();
10
+ if (deviceInfo) return deviceInfo.os.toLowerCase() == "android";
11
+ console.log("Can't check OS");
12
+ return null;
13
+ };
14
+
15
+ export const isMobile = () => {
16
+ if (typeof navigator == "undefined") return null;
17
+
18
+ if (
19
+ navigator.userAgent.match(/Android/i) ||
20
+ navigator.userAgent.match(/webOS/i) ||
21
+ navigator.userAgent.match(/iPhone/i) ||
22
+ navigator.userAgent.match(/iPad/i) ||
23
+ navigator.userAgent.match(/iPod/i) ||
24
+ navigator.userAgent.match(/BlackBerry/i) ||
25
+ navigator.userAgent.match(/Windows Phone/i)
26
+ ) {
27
+ return true;
28
+ } else {
29
+ return false;
30
+ }
31
+ };
32
+
33
+ /**
34
+ *
35
+ * @returns {{
36
+ * screen,
37
+ * browser,
38
+ * browserVersion,
39
+ * browserMajorVersion,
40
+ * mobile,
41
+ * os,
42
+ * osVersion,
43
+ * cookies,
44
+ * flashVersion,
45
+ * }}
46
+ */
47
+ let deviceInfo: any;
48
+ export const checkOS = () => {
49
+ if (typeof window == "undefined") return {};
50
+
51
+ if (typeof deviceInfo == "undefined") {
52
+ var unknown = "-";
53
+
54
+ // screen
55
+ var screenSize = "";
56
+ if (screen.width) {
57
+ var width = screen.width ? screen.width : "";
58
+ var height = screen.height ? screen.height : "";
59
+ screenSize += "" + width + " x " + height;
60
+ }
61
+
62
+ // browser
63
+ var nVer = navigator.appVersion;
64
+ var nAgt = navigator.userAgent;
65
+ var browser = navigator.appName;
66
+ var version = "" + parseFloat(navigator.appVersion);
67
+ var majorVersion = parseInt(navigator.appVersion, 10);
68
+ var nameOffset, verOffset, ix;
69
+
70
+ // Opera
71
+ if ((verOffset = nAgt.indexOf("Opera")) != -1) {
72
+ browser = "Opera";
73
+ version = nAgt.substring(verOffset + 6);
74
+ if ((verOffset = nAgt.indexOf("Version")) != -1) {
75
+ version = nAgt.substring(verOffset + 8);
76
+ }
77
+ }
78
+ // Opera Next
79
+ if ((verOffset = nAgt.indexOf("OPR")) != -1) {
80
+ browser = "Opera";
81
+ version = nAgt.substring(verOffset + 4);
82
+ }
83
+ // Edge
84
+ else if ((verOffset = nAgt.indexOf("Edge")) != -1) {
85
+ browser = "Microsoft Edge";
86
+ version = nAgt.substring(verOffset + 5);
87
+ }
88
+ // MSIE
89
+ else if ((verOffset = nAgt.indexOf("MSIE")) != -1) {
90
+ browser = "Microsoft Internet Explorer";
91
+ version = nAgt.substring(verOffset + 5);
92
+ }
93
+ // Chrome
94
+ else if ((verOffset = nAgt.indexOf("Chrome")) != -1) {
95
+ browser = "Chrome";
96
+ version = nAgt.substring(verOffset + 7);
97
+ }
98
+ // Safari
99
+ else if ((verOffset = nAgt.indexOf("Safari")) != -1) {
100
+ browser = "Safari";
101
+ version = nAgt.substring(verOffset + 7);
102
+ if ((verOffset = nAgt.indexOf("Version")) != -1) {
103
+ version = nAgt.substring(verOffset + 8);
104
+ }
105
+ }
106
+ // Firefox
107
+ else if ((verOffset = nAgt.indexOf("Firefox")) != -1) {
108
+ browser = "Firefox";
109
+ version = nAgt.substring(verOffset + 8);
110
+ }
111
+ // MSIE 11+
112
+ else if (nAgt.indexOf("Trident/") != -1) {
113
+ browser = "Microsoft Internet Explorer";
114
+ version = nAgt.substring(nAgt.indexOf("rv:") + 3);
115
+ }
116
+ // Other browsers
117
+ else if ((nameOffset = nAgt.lastIndexOf(" ") + 1) < (verOffset = nAgt.lastIndexOf("/"))) {
118
+ browser = nAgt.substring(nameOffset, verOffset);
119
+ version = nAgt.substring(verOffset + 1);
120
+ if (browser.toLowerCase() == browser.toUpperCase()) {
121
+ browser = navigator.appName;
122
+ }
123
+ }
124
+ // trim the version string
125
+ if ((ix = version.indexOf(";")) != -1) version = version.substring(0, ix);
126
+ if ((ix = version.indexOf(" ")) != -1) version = version.substring(0, ix);
127
+ if ((ix = version.indexOf(")")) != -1) version = version.substring(0, ix);
128
+
129
+ majorVersion = parseInt("" + version, 10);
130
+ if (isNaN(majorVersion)) {
131
+ version = "" + parseFloat(navigator.appVersion);
132
+ majorVersion = parseInt(navigator.appVersion, 10);
133
+ }
134
+
135
+ // mobile version
136
+ var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
137
+
138
+ // cookie
139
+ var cookieEnabled = navigator.cookieEnabled ? true : false;
140
+
141
+ if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
142
+ document.cookie = "testcookie";
143
+ cookieEnabled = document.cookie.indexOf("testcookie") != -1 ? true : false;
144
+ }
145
+
146
+ // system
147
+ var os = unknown;
148
+ var clientStrings = [
149
+ { s: "Windows 10", r: /(Windows 10.0|Windows NT 10.0)/ },
150
+ { s: "Windows 8.1", r: /(Windows 8.1|Windows NT 6.3)/ },
151
+ { s: "Windows 8", r: /(Windows 8|Windows NT 6.2)/ },
152
+ { s: "Windows 7", r: /(Windows 7|Windows NT 6.1)/ },
153
+ { s: "Windows Vista", r: /Windows NT 6.0/ },
154
+ { s: "Windows Server 2003", r: /Windows NT 5.2/ },
155
+ { s: "Windows XP", r: /(Windows NT 5.1|Windows XP)/ },
156
+ { s: "Windows 2000", r: /(Windows NT 5.0|Windows 2000)/ },
157
+ { s: "Windows ME", r: /(Win 9x 4.90|Windows ME)/ },
158
+ { s: "Windows 98", r: /(Windows 98|Win98)/ },
159
+ { s: "Windows 95", r: /(Windows 95|Win95|Windows_95)/ },
160
+ { s: "Windows NT 4.0", r: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
161
+ { s: "Windows CE", r: /Windows CE/ },
162
+ { s: "Windows 3.11", r: /Win16/ },
163
+ { s: "Android", r: /Android/ },
164
+ { s: "Open BSD", r: /OpenBSD/ },
165
+ { s: "Sun OS", r: /SunOS/ },
166
+ { s: "Linux", r: /(Linux|X11)/ },
167
+ { s: "iOS", r: /(iPhone|iPad|iPod)/ },
168
+ { s: "Mac OS X", r: /Mac OS X/ },
169
+ { s: "Mac OS", r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
170
+ { s: "QNX", r: /QNX/ },
171
+ { s: "UNIX", r: /UNIX/ },
172
+ { s: "BeOS", r: /BeOS/ },
173
+ { s: "OS/2", r: /OS\/2/ },
174
+ { s: "Search Bot", r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ },
175
+ ];
176
+ for (var id in clientStrings) {
177
+ var cs = clientStrings[id];
178
+ if (cs.r.test(nAgt)) {
179
+ os = cs.s;
180
+ break;
181
+ }
182
+ }
183
+
184
+ var osVersion = unknown;
185
+
186
+ if (/Windows/.test(os)) {
187
+ const _osv = /Windows (.*)/.exec(os) || [];
188
+ osVersion = _osv[1] || "unknown";
189
+ os = "Windows";
190
+ }
191
+
192
+ switch (os) {
193
+ case "Mac OS X":
194
+ const _osvx = /Mac OS X (10[\.\_\d]+)/.exec(nAgt);
195
+ osVersion = _osvx?.[1] || "unknown";
196
+ break;
197
+
198
+ case "Android":
199
+ osVersion = /Android ([\.\_\d]+)/.exec(nAgt)?.[1] || "unknown";
200
+ break;
201
+
202
+ case "iOS":
203
+ const _osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer) || [0, 0, 0];
204
+ osVersion = (_osVersion[1] || 0) + "." + (_osVersion[2] || 0) + "." + (_osVersion[3] || 0);
205
+ break;
206
+ }
207
+
208
+ const _deviceInfo = {
209
+ screen: screenSize,
210
+ browser: browser,
211
+ browserVersion: version,
212
+ browserMajorVersion: majorVersion,
213
+ mobile: mobile,
214
+ os: os,
215
+ osVersion: osVersion,
216
+ cookies: cookieEnabled,
217
+ };
218
+
219
+ deviceInfo = _deviceInfo;
220
+ }
221
+
222
+ return deviceInfo;
223
+ };
@@ -0,0 +1,14 @@
1
+ const fs = require("fs");
2
+
3
+ /**
4
+ * Create new directory
5
+ */
6
+ function createDir(path: string) {
7
+ if (fs.existsSync(path)) {
8
+ console.log("directory already exited !");
9
+ return true;
10
+ }
11
+ fs.mkdirSync(path, { recursive: true });
12
+ }
13
+
14
+ export { createDir };
@@ -0,0 +1,32 @@
1
+ const fs = require("fs");
2
+
3
+ /**
4
+ * Move file to another location.
5
+ */
6
+ export function fileMove(oldPath: string, newPath: string, callback: any) {
7
+ fs.rename(oldPath, newPath, function (err: any) {
8
+ if (err) {
9
+ if (err.code === "EXDEV") {
10
+ copy();
11
+ } else {
12
+ callback(err);
13
+ }
14
+ return;
15
+ }
16
+ callback();
17
+ });
18
+
19
+ function copy() {
20
+ var readStream = fs.createReadStream(oldPath);
21
+ var writeStream = fs.createWriteStream(newPath);
22
+
23
+ readStream.on("error", callback);
24
+ writeStream.on("error", callback);
25
+
26
+ readStream.on("close", function () {
27
+ fs.unlink(oldPath, callback);
28
+ });
29
+
30
+ readStream.pipe(writeStream);
31
+ }
32
+ }
@@ -0,0 +1,39 @@
1
+ var path = require("path");
2
+ var fs = require("fs");
3
+
4
+ /**
5
+ *
6
+ */
7
+ const forEachFileByExt = (base: string, ext: string, cb: (path: string) => {}) => {
8
+ var walk = function (directoryName: string) {
9
+ try {
10
+ fs.readdir(directoryName, function (e: any, files: string[]) {
11
+ if (e) {
12
+ console.log("Error: ", e);
13
+ return;
14
+ }
15
+ files.forEach(function (file: string) {
16
+ var fullPath = path.join(directoryName, file);
17
+ fs.stat(fullPath, function (e: any, f: any) {
18
+ if (e) {
19
+ console.log("Error: ", e);
20
+ return;
21
+ }
22
+ if (f.isDirectory()) {
23
+ walk(fullPath);
24
+ } else {
25
+ if (fullPath.toLowerCase().indexOf(ext.toLowerCase()) > -1) {
26
+ if (cb) cb(fullPath);
27
+ }
28
+ }
29
+ });
30
+ });
31
+ });
32
+ } catch (error) {
33
+ console.log("error", error);
34
+ }
35
+ };
36
+ walk(base);
37
+ };
38
+
39
+ export { forEachFileByExt };
package/src/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ export * from "./array";
2
+ export * from "./device";
3
+ export * from "./console";
4
+ export * from "./device/browser";
5
+ export * from "./device/camera";
6
+ export * from "./math";
7
+ export * from "./object";
8
+ export * from "./string";
9
+ export * from "./string/url";
10
+ export * from "./file/createDir";
11
+ export * from "./file/fileMove";
12
+ export * from "./file/findFilesByExt";
13
+
14
+ export * from "./Timer";
15
+ export * from "./permission/requestCamera";
16
+ export * from "./permission/requestDeviceOrientationControl";
17
+ export * from "./console/enableConsole";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns amount of different days between 2 dates
3
+ */
4
+ export function diffDate(date1: string, date2: string) {
5
+ date1 = date1 || new Date().toString();
6
+ date2 = date2 || new Date().toString();
7
+ return (new Date(date2).getTime() - new Date(date1).getTime()) / (24 * 60 * 60 * 1000);
8
+ }
@@ -0,0 +1,88 @@
1
+ const DEG2RAD = Math.PI / 180;
2
+ const RAD2DEG = 180 / Math.PI;
3
+
4
+ /**
5
+ *
6
+ * @param {Number} number
7
+ * @return {Number}
8
+ */
9
+ export const randRound = (number: number) => {
10
+ return Math.round(Math.random() * number);
11
+ };
12
+
13
+ /**
14
+ *
15
+ * @param {Number} number
16
+ * @return {Number}
17
+ */
18
+ export const rand = (number: number) => {
19
+ return (Math.random() - Math.random()) * number;
20
+ };
21
+
22
+ /**
23
+ *
24
+ * @param {Number} number
25
+ * @return {Number}
26
+ */
27
+ export const randHalt = (number: number) => {
28
+ var rand = Math.random() - Math.random();
29
+ var res;
30
+ if (rand > 0) {
31
+ res = rand * (number / 2) + number / 2;
32
+ } else {
33
+ res = rand * (number / 2) - number / 2;
34
+ }
35
+ return Math.abs(res);
36
+ };
37
+ /**
38
+ *
39
+ * @param {Number} low
40
+ * @param {Number} high
41
+ * @return {Number}
42
+ */
43
+ export const randInt = (low: number, high: number) => {
44
+ return low + Math.floor(Math.random() * (high - low + 1));
45
+ };
46
+
47
+ /**
48
+ *
49
+ * @param {Number} low
50
+ * @param {Number} high
51
+ * @return {Number}
52
+ */
53
+ export const randFloat = (low: number, high: number) => {
54
+ return low + Math.random() * (high - low);
55
+ };
56
+ /**
57
+ *
58
+ * @param {Number} degrees
59
+ * @return {Number}
60
+ */
61
+ export const degToRad = (degrees: number) => {
62
+ return degrees * DEG2RAD;
63
+ };
64
+
65
+ /**
66
+ *
67
+ * @param {Number} degrees
68
+ * @return {Number}
69
+ */
70
+ export const radToDeg = (radians: number) => {
71
+ return radians * RAD2DEG;
72
+ };
73
+
74
+ /**
75
+ *
76
+ * @param {Number} cx
77
+ * @param {Number} cy
78
+ * @param {Number} ex
79
+ * @param {Number} ey
80
+ * @returns {Number}
81
+ */
82
+ export const angleBetweenPoints = (cx: number, cy: number, ex: number, ey: number) => {
83
+ var dy = ey - cy;
84
+ var dx = ex - cx;
85
+ var theta = Math.atan2(dy, dx); // range (-PI, PI]
86
+ theta *= 180 / Math.PI; // rads to degs, range (-180, 180]
87
+ return theta;
88
+ };
@@ -0,0 +1,10 @@
1
+ import { isNull } from "../object";
2
+
3
+ export function positiveNumber(number: number) {
4
+ if (isNull(number)) return 0;
5
+ if (!Number.isFinite(Number(number))) return 0;
6
+ number = Number(number);
7
+ if (number < 0) return 0;
8
+
9
+ return number;
10
+ }
package/src/name/en.ts ADDED
@@ -0,0 +1,24 @@
1
+ /*
2
+ (c) by Thomas Konings
3
+ Random Name Generator for Javascript
4
+ https://gist.github.com/tkon99/4c98af713acc73bed74c
5
+ */
6
+
7
+ function capFirst(string: string) {
8
+ return string.charAt(0).toUpperCase() + string.slice(1);
9
+ }
10
+
11
+ function getRandomInt(min: number, max: number) {
12
+ return Math.floor(Math.random() * (max - min)) + min;
13
+ }
14
+
15
+ export function generateName() {
16
+ //prettier-ignore
17
+ var name1 = ["abandoned","able","absolute","adorable","adventurous","academic","acceptable","acclaimed","accomplished","accurate","aching","acidic","acrobatic","active","actual","adept","admirable","admired","adolescent","adorable","adored","advanced","afraid","affectionate","aged","aggravating","aggressive","agile","agitated","agonizing","agreeable","ajar","alarmed","alarming","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","amusing","anchored","ancient","angelic","angry","anguished","animated","annual","another","antique","anxious","any","apprehensive","appropriate","apt","arctic","arid","aromatic","artistic","ashamed","assured","astonishing","athletic","attached","attentive","attractive","austere","authentic","authorized","automatic","avaricious","average","aware","awesome","awful","awkward","babyish","bad","back","baggy","bare","barren","basic","beautiful","belated","beloved","beneficial","better","best","bewitched","big","big-hearted","biodegradable","bite-sized","bitter","black","black-and-white","bland","blank","blaring","bleak","blind","blissful","blond","blue","blushing","bogus","boiling","bold","bony","boring","bossy","both","bouncy","bountiful","bowed","brave","breakable","brief","bright","brilliant","brisk","broken","bronze","brown","bruised","bubbly","bulky","bumpy","buoyant","burdensome","burly","bustling","busy","buttery","buzzing","calculating","calm","candid","canine","capital","carefree","careful","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","cheery","chief","chilly","chubby","circular","classic","clean","clear","clear-cut","clever","close","closed","cloudy","clueless","clumsy","cluttered","coarse","cold","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complex","complicated","composed","concerned","concrete","confused","conscious","considerate","constant","content","conventional","cooked","cool","cooperative","coordinated","corny","corrupt","costly","courageous","courteous","crafty","crazy","creamy","creative","creepy","criminal","crisp","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cultured","cumbersome","curly","curvy","cute","cylindrical","damaged","damp","dangerous","dapper","daring","darling","dark","dazzling","dead","deadly","deafening","dear","dearest","decent","decimal","decisive","deep","defenseless","defensive","defiant","deficient","definite","definitive","delayed","delectable","delicious","delightful","delirious","demanding","dense","dental","dependable","dependent","descriptive","deserted","detailed","determined","devoted","different","difficult","digital","diligent","dim","dimpled","dimwitted","direct","disastrous","discrete","disfigured","disgusting","disloyal","dismal","distant","downright","dreary","dirty","disguised","dishonest","dismal","distant","distinct","distorted","dizzy","dopey","doting","double","downright","drab","drafty","dramatic","dreary","droopy","dry","dual","dull","dutiful","each","eager","earnest","early","easy","easy-going","ecstatic","edible","educated","elaborate","elastic","elated","elderly","electric","elegant","elementary","elliptical","embarrassed","embellished","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enormous","enraged","entire","envious","equal","equatorial","essential","esteemed","ethical","euphoric","even","evergreen","everlasting","every","evil","exalted","excellent","exemplary","exhausted","excitable","excited","exciting","exotic","expensive","experienced","expert","extraneous","extroverted","extra-large","extra-small","fabulous","failing","faint","fair","faithful","fake","false","familiar","famous","fancy","fantastic","far","faraway","far-flung","far-off","fast","fat","fatal","fatherly","favorable","favorite","fearful","fearless","feisty","feline","female","feminine","few","fickle","filthy","fine","finished","firm","first","firsthand","fitting","fixed","flaky","flamboyant","flashy","flat","flawed","flawless","flickering","flimsy","flippant","flowery","fluffy","fluid","flustered","focused","fond","foolhardy","foolish","forceful","forked","formal","forsaken","forthright","fortunate","fragrant","frail","frank","frayed","free","French","fresh","frequent","friendly","frightened","frightening","frigid","frilly","frizzy","frivolous","front","frosty","frozen","frugal","fruitful","full","fumbling","functional","funny","fussy","fuzzy","gargantuan","gaseous","general","generous","gentle","genuine","giant","giddy","gigantic","gifted","giving","glamorous","glaring","glass","gleaming","gleeful","glistening","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grand","grandiose","granular","grateful","grave","gray","great","greedy","green","gregarious","grim","grimy","gripping","grizzled","gross","grotesque","grouchy","grounded","growing","growling","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","half","handmade","handsome","handy","happy","happy-go-lucky","hard","hard-to-find","harmful","harmless","harmonious","harsh","hasty","hateful","haunting","healthy","heartfelt","hearty","heavenly","heavy","hefty","helpful","helpless","hidden","hideous","high","high-level","hilarious","hoarse","hollow","homely","honest","honorable","honored","hopeful","horrible","hospitable","hot","huge","humble","humiliating","humming","humongous","hungry","hurtful","husky","icky","icy","ideal","idealistic","identical","idle","idiotic","idolized","ignorant","ill","illegal","ill-fated","ill-informed","illiterate","illustrious","imaginary","imaginative","immaculate","immaterial","immediate","immense","impassioned","impeccable","impartial","imperfect","imperturbable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incompatible","incomplete","inconsequential","incredible","indelible","inexperienced","indolent","infamous","infantile","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","insubstantial","intelligent","intent","intentional","interesting","internal","international","intrepid","ironclad","irresponsible","irritating","itchy","jaded","jagged","jam-packed","jaunty","jealous","jittery","joint","jolly","jovial","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","jumpy","juvenile","kaleidoscopic","keen","key","kind","kindhearted","kindly","klutzy","knobby","knotty","knowledgeable","knowing","known","kooky","kosher","lame","lanky","large","last","lasting","late","lavish","lawful","lazy","leading","lean","leafy","left","legal","legitimate","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","loathsome","lone","lonely","long","long-term","loose","lopsided","lost","loud","lovable","lovely","loving","low","loyal","lucky","lumbering","luminous","lumpy","lustrous","luxurious","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","masculine","massive","mature","meager","mealy","mean","measly","meaty","medical","mediocre","medium","meek","mellow","melodic","memorable","menacing","merry","messy","metallic","mild","milky","mindless","miniature","minor","minty","miserable","miserly","misguided","misty","mixed","modern","modest","moist","monstrous","monthly","monumental","moral","mortified","motherly","motionless","mountainous","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","naive","narrow","nasty","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","noisy","nonstop","normal","notable","noted","noteworthy","novel","noxious","numb","nutritious","nutty","obedient","obese","oblong","oily","oblong","obvious","occasional","odd","oddball","offbeat","offensive","official","old","old-fashioned","only","open","optimal","optimistic","opulent","orange","orderly","organic","ornate","ornery","ordinary","original","other","our","outlying","outgoing","outlandish","outrageous","outstanding","oval","overcooked","overdue","overjoyed","overlooked","palatable","pale","paltry","parallel","parched","partial","passionate","past","pastel","peaceful","peppery","perfect","perfumed","periodic","perky","personal","pertinent","pesky","pessimistic","petty","phony","physical","piercing","pink","pitiful","plain","plaintive","plastic","playful","pleasant","pleased","pleasing","plump","plush","polished","polite","political","pointed","pointless","poised","poor","popular","portly","posh","positive","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","precious","previous","pricey","prickly","primary","prime","pristine","private","prize","probable","productive","profitable","profuse","proper","proud","prudent","punctual","pungent","puny","pure","purple","pushy","putrid","puzzled","puzzling","quaint","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quirky","quixotic","quizzical","radiant","ragged","rapid","rare","rash","raw","recent","reckless","rectangular","ready","real","realistic","reasonable","red","reflecting","regal","regular","reliable","relieved","remarkable","remorseful","remote","repentant","required","respectful","responsible","repulsive","revolving","rewarding","rich","rigid","right","ringed","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","rundown","ruddy","rude","runny","rural","rusty","sad","safe","salty","same","sandy","sane","sarcastic","sardonic","satisfied","scaly","scarce","scared","scary","scented","scholarly","scientific","scornful","scratchy","scrawny","second","secondary","second-hand","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serious","serpentine","several","severe","shabby","shadowy","shady","shallow","shameful","shameless","sharp","shimmering","shiny","shocked","shocking","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silly","silver","similar","simple","simplistic","sinful","single","sizzling","skeletal","skinny","sleepy","slight","slim","slimy","slippery","slow","slushy","small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","solid","somber","some","spherical","sophisticated","sore","sorrowful","soulful","soupy","sour","Spanish","sparkling","sparse","specific","spectacular","speedy","spicy","spiffy","spirited","spiteful","splendid","spotless","spotted","spry","square","squeaky","squiggly","stable","staid","stained","stale","standard","starchy","stark","starry","steep","sticky","stiff","stimulating","stingy","stormy","straight","strange","steel","strict","strident","striking","striped","strong","studious","stunning","stupendous","stupid","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","suspicious","svelte","sweaty","sweet","sweltering","swift","sympathetic","tall","talkative","tame","tan","tangible","tart","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","terrific","testy","thankful","that","these","thick","thin","third","thirsty","this","thorough","thorny","those","thoughtful","threadbare","thrifty","thunderous","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","traumatic","treasured","tremendous","tragic","trained","tremendous","triangular","tricky","trifling","trim","trivial","troubled","true","trusting","trustworthy","trusty","truthful","tubby","turbulent","twin","ugly","ultimate","unacceptable","unaware","uncomfortable","uncommon","unconscious","understated","unequaled","uneven","unfinished","unfit","unfolded","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","united","unkempt","unknown","unlawful","unlined","unlucky","unnatural","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwitting","unwritten","upbeat","upright","upset","urban","usable","used","useful","useless","utilized","utter","vacant","vague","vain","valid","valuable","vapid","variable","vast","velvety","venerated","vengeful","verifiable","vibrant","vicious","victorious","vigilant","vigorous","villainous","violet","violent","virtual","virtuous","visible","vital","vivacious","vivid","voluminous","wan","warlike","warm","warmhearted","warped","wary","wasteful","watchful","waterlogged","watery","wavy","wealthy","weak","weary","webbed","wee","weekly","weepy","weighty","weird","welcome","well-documented","well-groomed","well-informed","well-lit","well-made","well-off","well-to-do","well-worn","wet","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","wild","willing","wilted","winding","windy","winged","wiry","wise","witty","wobbly","woeful","wonderful","wooden","woozy","wordy","worldly","worn","worried","worrisome","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yawning","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty","zigzag","rocky"];
18
+
19
+ //prettier-ignore
20
+ var name2 = ["people","history","way","art","world","information","map","family","government","health","system","computer","meat","year","thanks","music","person","reading","method","data","food","understanding","theory","law","bird","literature","problem","software","control","knowledge","power","ability","economics","love","internet","television","science","library","nature","fact","product","idea","temperature","investment","area","society","activity","story","industry","media","thing","oven","community","definition","safety","quality","development","language","management","player","variety","video","week","security","country","exam","movie","organization","equipment","physics","analysis","policy","series","thought","basis","boyfriend","direction","strategy","technology","army","camera","freedom","paper","environment","child","instance","month","truth","marketing","university","writing","article","department","difference","goal","news","audience","fishing","growth","income","marriage","user","combination","failure","meaning","medicine","philosophy","teacher","communication","night","chemistry","disease","disk","energy","nation","road","role","soup","advertising","location","success","addition","apartment","education","math","moment","painting","politics","attention","decision","event","property","shopping","student","wood","competition","distribution","entertainment","office","population","president","unit","category","cigarette","context","introduction","opportunity","performance","driver","flight","length","magazine","newspaper","relationship","teaching","cell","dealer","debate","finding","lake","member","message","phone","scene","appearance","association","concept","customer","death","discussion","housing","inflation","insurance","mood","woman","advice","blood","effort","expression","importance","opinion","payment","reality","responsibility","situation","skill","statement","wealth","application","city","county","depth","estate","foundation","grandmother","heart","perspective","photo","recipe","studio","topic","collection","depression","imagination","passion","percentage","resource","setting","ad","agency","college","connection","criticism","debt","description","memory","patience","secretary","solution","administration","aspect","attitude","director","personality","psychology","recommendation","response","selection","storage","version","alcohol","argument","complaint","contract","emphasis","highway","loss","membership","possession","preparation","steak","union","agreement","cancer","currency","employment","engineering","entry","interaction","limit","mixture","preference","region","republic","seat","tradition","virus","actor","classroom","delivery","device","difficulty","drama","election","engine","football","guidance","hotel","match","owner","priority","protection","suggestion","tension","variation","anxiety","atmosphere","awareness","bread","climate","comparison","confusion","construction","elevator","emotion","employee","employer","guest","height","leadership","mall","manager","operation","recording","respect","sample","transportation","boring","charity","cousin","disaster","editor","efficiency","excitement","extent","feedback","guitar","homework","leader","mom","outcome","permission","presentation","promotion","reflection","refrigerator","resolution","revenue","session","singer","tennis","basket","bonus","cabinet","childhood","church","clothes","coffee","dinner","drawing","hair","hearing","initiative","judgment","lab","measurement","mode","mud","orange","poetry","police","possibility","procedure","queen","ratio","relation","restaurant","satisfaction","sector","signature","significance","song","tooth","town","vehicle","volume","wife","accident","airport","appointment","arrival","assumption","baseball","chapter","committee","conversation","database","enthusiasm","error","explanation","farmer","gate","girl","hall","historian","hospital","injury","instruction","maintenance","manufacturer","meal","perception","pie","poem","presence","proposal","reception","replacement","revolution","river","son","speech","tea","village","warning","winner","worker","writer","assistance","breath","buyer","chest","chocolate","conclusion","contribution","cookie","courage","desk","drawer","establishment","examination","garbage","grocery","honey","impression","improvement","independence","insect","inspection","inspector","king","ladder","menu","penalty","piano","potato","profession","professor","quantity","reaction","requirement","salad","sister","supermarket","tongue","weakness","wedding","affair","ambition","analyst","apple","assignment","assistant","bathroom","bedroom","beer","birthday","celebration","championship","cheek","client","consequence","departure","diamond","dirt","ear","fortune","friendship","funeral","gene","girlfriend","hat","indication","intention","lady","midnight","negotiation","obligation","passenger","pizza","platform","poet","pollution","recognition","reputation","shirt","speaker","stranger","surgery","sympathy","tale","throat","trainer","uncle","youth","time","work","film","water","money","example","while","business","study","game","life","form","air","day","place","number","part","field","fish","back","process","heat","hand","experience","job","book","end","point","type","home","economy","value","body","market","guide","interest","state","radio","course","company","price","size","card","list","mind","trade","line","care","group","risk","word","fat","force","key","light","training","name","school","top","amount","level","order","practice","research","sense","service","piece","web","boss","sport","fun","house","page","term","test","answer","sound","focus","matter","kind","soil","board","oil","picture","access","garden","range","rate","reason","future","site","demand","exercise","image","case","cause","coast","action","age","bad","boat","record","result","section","building","mouse","cash","class","period","plan","store","tax","side","subject","space","rule","stock","weather","chance","figure","man","model","source","beginning","earth","program","chicken","design","feature","head","material","purpose","question","rock","salt","act","birth","car","dog","object","scale","sun","note","profit","rent","speed","style","war","bank","craft","half","inside","outside","standard","bus","exchange","eye","fire","position","pressure","stress","advantage","benefit","box","frame","issue","step","cycle","face","item","metal","paint","review","room","screen","structure","view","account","ball","discipline","medium","share","balance","bit","black","bottom","choice","gift","impact","machine","shape","tool","wind","address","average","career","culture","morning","pot","sign","table","task","condition","contact","credit","egg","hope","ice","network","north","square","attempt","date","effect","link","post","star","voice","capital","challenge","friend","self","shot","brush","couple","exit","front","function","lack","living","plant","plastic","spot","summer","taste","theme","track","wing","brain","button","click","desire","foot","gas","influence","notice","rain","wall","base","damage","distance","feeling","pair","savings","staff","sugar","target","text","animal","author","budget","discount","file","ground","lesson","minute","officer","phase","reference","register","sky","stage","stick","title","trouble","bowl","bridge","campaign","character","club","edge","evidence","fan","letter","lock","maximum","novel","option","pack","park","quarter","skin","sort","weight","baby","background","carry","dish","factor","fruit","glass","joint","master","muscle","red","strength","traffic","trip","vegetable","appeal","chart","gear","ideal","kitchen","land","log","mother","net","party","principle","relative","sale","season","signal","spirit","street","tree","wave","belt","bench","commission","copy","drop","minimum","path","progress","project","sea","south","status","stuff","ticket","tour","angle","blue","breakfast","confidence","daughter","degree","doctor","dot","dream","duty","essay","father","fee","finance","hour","juice","luck","milk","mouth","peace","pipe","stable","storm","substance","team","trick","afternoon","bat","beach","blank","catch","chain","consideration","cream","crew","detail","gold","interview","kid","mark","mission","pain","pleasure","score","screw","sex","shop","shower","suit","tone","window","agent","band","bath","block","bone","calendar","candidate","cap","coat","contest","corner","court","cup","district","door","east","finger","garage","guarantee","hole","hook","implement","layer","lecture","lie","manner","meeting","nose","parking","partner","profile","rice","routine","schedule","swimming","telephone","tip","winter","airline","bag","battle","bed","bill","bother","cake","code","curve","designer","dimension","dress","ease","emergency","evening","extension","farm","fight","gap","grade","holiday","horror","horse","host","husband","loan","mistake","mountain","nail","noise","occasion","package","patient","pause","phrase","proof","race","relief","sand","sentence","shoulder","smoke","stomach","string","tourist","towel","vacation","west","wheel","wine","arm","aside","associate","bet","blow","border","branch","breast","brother","buddy","bunch","chip","coach","cross","document","draft","dust","expert","floor","god","golf","habit","iron","judge","knife","landscape","league","mail","mess","native","opening","parent","pattern","pin","pool","pound","request","salary","shame","shelter","shoe","silver","tackle","tank","trust","assist","bake","bar","bell","bike","blame","boy","brick","chair","closet","clue","collar","comment","conference","devil","diet","fear","fuel","glove","jacket","lunch","monitor","mortgage","nurse","pace","panic","peak","plane","reward","row","sandwich","shock","spite","spray","surprise","till","transition","weekend","welcome","yard","alarm","bend","bicycle","bite","blind","bottle","cable","candle","clerk","cloud","concert","counter","flower","grandfather","harm","knee","lawyer","leather","load","mirror","neck","pension","plate","purple","ruin","ship","skirt","slice","snow","specialist","stroke","switch","trash","tune","zone","anger","award","bid","bitter","boot","bug","camp","candy","carpet","cat","champion","channel","clock","comfort","cow","crack","engineer","entrance","fault","grass","guy","hell","highlight","incident","island","joke","jury","leg","lip","mate","motor","nerve","passage","pen","pride","priest","prize","promise","resident","resort","ring","roof","rope","sail","scheme","script","sock","station","toe","tower","truck","witness","can","will","other","use","make","good","look","help","go","great","being","still","public","read","keep","start","give","human","local","general","specific","long","play","feel","high","put","common","set","change","simple","past","big","possible","particular","major","personal","current","national","cut","natural","physical","show","try","check","second","call","move","pay","let","increase","single","individual","turn","ask","buy","guard","hold","main","offer","potential","professional","international","travel","cook","alternative","special","working","whole","dance","excuse","cold","commercial","low","purchase","deal","primary","worth","fall","necessary","positive","produce","search","present","spend","talk","creative","tell","cost","drive","green","support","glad","remove","return","run","complex","due","effective","middle","regular","reserve","independent","leave","original","reach","rest","serve","watch","beautiful","charge","active","break","negative","safe","stay","visit","visual","affect","cover","report","rise","walk","white","junior","pick","unique","classic","final","lift","mix","private","stop","teach","western","concern","familiar","fly","official","broad","comfortable","gain","rich","save","stand","young","heavy","lead","listen","valuable","worry","handle","leading","meet","release","sell","finish","normal","press","ride","secret","spread","spring","tough","wait","brown","deep","display","flow","hit","objective","shoot","touch","cancel","chemical","cry","dump","extreme","push","conflict","eat","fill","formal","jump","kick","opposite","pass","pitch","remote","total","treat","vast","abuse","beat","burn","deposit","print","raise","sleep","somewhere","advance","consist","dark","double","draw","equal","fix","hire","internal","join","kill","sensitive","tap","win","attack","claim","constant","drag","drink","guess","minor","pull","raw","soft","solid","wear","weird","wonder","annual","count","dead","doubt","feed","forever","impress","repeat","round","sing","slide","strip","wish","combine","command","dig","divide","equivalent","hang","hunt","initial","march","mention","spiritual","survey","tie","adult","brief","crazy","escape","gather","hate","prior","repair","rough","sad","scratch","sick","strike","employ","external","hurt","illegal","laugh","lay","mobile","nasty","ordinary","respond","royal","senior","split","strain","struggle","swim","train","upper","wash","yellow","convert","crash","dependent","fold","funny","grab","hide","miss","permit","quote","recover","resolve","roll","sink","slip","spare","suspect","sweet","swing","twist","upstairs","usual","abroad","brave","calm","concentrate","estimate","grand","male","mine","prompt","quiet","refuse","regret","reveal","rush","shake","shift","shine","steal","suck","surround","bear","brilliant","dare","dear","delay","drunk","female","hurry","inevitable","invite","kiss","neat","pop","punch","quit","reply","representative","resist","rip","rub","silly","smile","spell","stretch","stupid","tear","temporary","tomorrow","wake","wrap","yesterday","Thomas","Tom","Lieuwe"];
21
+
22
+ var name = capFirst(name1[getRandomInt(0, name1.length - 1)]) + " " + capFirst(name2[getRandomInt(0, name2.length - 1)]);
23
+ return name;
24
+ }