diginext-utils 2.0.33 → 2.0.36

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 (359) hide show
  1. package/dist/Checker.d.ts +3 -4
  2. package/dist/Checker.js +32 -52
  3. package/dist/Checker.js.map +1 -0
  4. package/dist/EventDispatcher.d.ts +3 -3
  5. package/dist/EventDispatcher.js +52 -77
  6. package/dist/EventDispatcher.js.map +1 -0
  7. package/dist/FileUpload.d.ts +3 -3
  8. package/dist/FileUpload.js +65 -85
  9. package/dist/FileUpload.js.map +1 -0
  10. package/dist/Slug.d.ts +3 -4
  11. package/dist/Slug.js +334 -354
  12. package/dist/Slug.js.map +1 -0
  13. package/dist/Timer.d.ts +4 -1
  14. package/dist/Timer.js +9 -33
  15. package/dist/Timer.js.map +1 -0
  16. package/dist/Validation.d.ts +2 -3
  17. package/dist/Validation.js +39 -56
  18. package/dist/Validation.js.map +1 -0
  19. package/dist/array.d.ts +113 -1
  20. package/dist/array.js +297 -277
  21. package/dist/array.js.map +1 -0
  22. package/dist/color.d.ts +8 -9
  23. package/dist/color.js +89 -106
  24. package/dist/color.js.map +1 -0
  25. package/dist/console/enableConsole.d.ts +2 -1
  26. package/dist/console/enableConsole.js +14 -42
  27. package/dist/console/enableConsole.js.map +1 -0
  28. package/dist/console/index.d.ts +11 -2
  29. package/dist/console/index.js +18 -61
  30. package/dist/console/index.js.map +1 -0
  31. package/dist/console/log.d.ts +8 -9
  32. package/dist/console/log.js +45 -75
  33. package/dist/console/log.js.map +1 -0
  34. package/dist/device/browser.d.ts +5 -1
  35. package/dist/device/browser.js +38 -66
  36. package/dist/device/browser.js.map +1 -0
  37. package/dist/device/camera.d.ts +7 -1
  38. package/dist/device/camera.js +172 -190
  39. package/dist/device/camera.js.map +1 -0
  40. package/dist/device/index.d.ts +5 -1
  41. package/dist/device/index.js +225 -210
  42. package/dist/device/index.js.map +1 -0
  43. package/dist/device/os.d.ts +6 -7
  44. package/dist/device/os.js +38 -65
  45. package/dist/device/os.js.map +1 -0
  46. package/dist/file/createDir.d.ts +5 -1
  47. package/dist/file/createDir.js +16 -37
  48. package/dist/file/createDir.js.map +1 -0
  49. package/dist/file/fileMove.d.ts +4 -1
  50. package/dist/file/fileMove.js +33 -53
  51. package/dist/file/fileMove.js.map +1 -0
  52. package/dist/file/findFilesByExt.d.ts +13 -1
  53. package/dist/file/findFilesByExt.js +50 -69
  54. package/dist/file/findFilesByExt.js.map +1 -0
  55. package/dist/file/index.d.ts +4 -6
  56. package/dist/file/index.js +11 -106
  57. package/dist/file/index.js.map +1 -0
  58. package/dist/images/index.d.ts +2 -2
  59. package/dist/images/index.js +9 -132
  60. package/dist/images/index.js.map +1 -0
  61. package/dist/images/loadImage.d.ts +1 -3
  62. package/dist/images/loadImage.js +18 -42
  63. package/dist/images/loadImage.js.map +1 -0
  64. package/dist/images/resize.d.ts +2 -3
  65. package/dist/images/resize.js +38 -64
  66. package/dist/images/resize.js.map +1 -0
  67. package/dist/images/upload.d.ts +3 -4
  68. package/dist/images/upload.js +27 -132
  69. package/dist/images/upload.js.map +1 -0
  70. package/dist/index.d.ts +19 -30
  71. package/dist/index.js +63 -1353
  72. package/dist/index.js.map +1 -0
  73. package/dist/json.d.ts +3 -4
  74. package/dist/json.js +32 -52
  75. package/dist/json.js.map +1 -0
  76. package/dist/math/diffDate.d.ts +2 -3
  77. package/dist/math/diffDate.js +14 -36
  78. package/dist/math/diffDate.js.map +1 -0
  79. package/dist/math/index.d.ts +30 -3
  80. package/dist/math/index.js +93 -160
  81. package/dist/math/index.js.map +1 -0
  82. package/dist/math/positiveNumber.d.ts +2 -3
  83. package/dist/math/positiveNumber.js +17 -56
  84. package/dist/math/positiveNumber.js.map +1 -0
  85. package/dist/name/en.d.ts +3 -4
  86. package/dist/name/en.js +26 -44
  87. package/dist/name/en.js.map +1 -0
  88. package/dist/name/index.d.ts +12 -3
  89. package/dist/name/index.js +13 -88
  90. package/dist/name/index.js.map +1 -0
  91. package/dist/name/vi.d.ts +3 -4
  92. package/dist/name/vi.js +28 -66
  93. package/dist/name/vi.js.map +1 -0
  94. package/dist/object.d.ts +59 -1
  95. package/dist/object.js +80 -105
  96. package/dist/object.js.map +1 -0
  97. package/dist/permission/index.d.ts +2 -3
  98. package/dist/permission/index.js +7 -231
  99. package/dist/permission/index.js.map +1 -0
  100. package/dist/permission/requestCamera.d.ts +5 -1
  101. package/dist/permission/requestCamera.js +43 -54
  102. package/dist/permission/requestCamera.js.map +1 -0
  103. package/dist/permission/requestDeviceOrientationControl.d.ts +2 -1
  104. package/dist/permission/requestDeviceOrientationControl.js +39 -206
  105. package/dist/permission/requestDeviceOrientationControl.js.map +1 -0
  106. package/dist/response/index.d.ts +6 -7
  107. package/dist/response/index.js +52 -97
  108. package/dist/response/index.js.map +1 -0
  109. package/dist/string/formatNumber.d.ts +2 -3
  110. package/dist/string/formatNumber.js +15 -56
  111. package/dist/string/formatNumber.js.map +1 -0
  112. package/dist/string/generatePassword.d.ts +2 -3
  113. package/dist/string/generatePassword.js +24 -55
  114. package/dist/string/generatePassword.js.map +1 -0
  115. package/dist/string/generateUUID.d.ts +2 -3
  116. package/dist/string/generateUUID.js +37 -40
  117. package/dist/string/generateUUID.js.map +1 -0
  118. package/dist/string/index.d.ts +65 -6
  119. package/dist/string/index.js +161 -316
  120. package/dist/string/index.js.map +1 -0
  121. package/dist/string/makeDaySlug.d.ts +3 -4
  122. package/dist/string/makeDaySlug.js +23 -47
  123. package/dist/string/makeDaySlug.js.map +1 -0
  124. package/dist/string/random.d.ts +8 -9
  125. package/dist/string/random.js +25 -56
  126. package/dist/string/random.js.map +1 -0
  127. package/dist/string/trimNull.d.ts +2 -3
  128. package/dist/string/trimNull.js +21 -49
  129. package/dist/string/trimNull.js.map +1 -0
  130. package/dist/string/url.d.ts +36 -1
  131. package/dist/string/url.js +107 -126
  132. package/dist/string/url.js.map +1 -0
  133. package/esm/Checker.d.ts +8 -0
  134. package/esm/Checker.js +28 -0
  135. package/esm/Checker.js.map +1 -0
  136. package/esm/EventDispatcher.d.ts +13 -0
  137. package/esm/EventDispatcher.js +49 -0
  138. package/esm/EventDispatcher.js.map +1 -0
  139. package/esm/FileUpload.d.ts +12 -0
  140. package/esm/FileUpload.js +62 -0
  141. package/esm/FileUpload.js.map +1 -0
  142. package/esm/Slug.d.ts +9 -0
  143. package/esm/Slug.js +330 -0
  144. package/esm/Slug.js.map +1 -0
  145. package/esm/Timer.d.ts +4 -0
  146. package/esm/Timer.js +7 -0
  147. package/esm/Timer.js.map +1 -0
  148. package/esm/Validation.d.ts +5 -0
  149. package/esm/Validation.js +37 -0
  150. package/esm/Validation.js.map +1 -0
  151. package/esm/array.d.ts +113 -0
  152. package/esm/array.js +275 -0
  153. package/esm/array.js.map +1 -0
  154. package/esm/color.d.ts +23 -0
  155. package/esm/color.js +80 -0
  156. package/esm/color.js.map +1 -0
  157. package/esm/console/enableConsole.d.ts +2 -0
  158. package/esm/console/enableConsole.js +7 -0
  159. package/esm/console/enableConsole.js.map +1 -0
  160. package/esm/console/index.d.ts +11 -0
  161. package/esm/console/index.js +13 -0
  162. package/esm/console/index.js.map +1 -0
  163. package/esm/console/log.d.ts +15 -0
  164. package/esm/console/log.js +33 -0
  165. package/esm/console/log.js.map +1 -0
  166. package/esm/device/browser.d.ts +5 -0
  167. package/esm/device/browser.js +30 -0
  168. package/esm/device/browser.js.map +1 -0
  169. package/esm/device/camera.d.ts +7 -0
  170. package/esm/device/camera.js +168 -0
  171. package/esm/device/camera.js.map +1 -0
  172. package/esm/device/index.d.ts +5 -0
  173. package/esm/device/index.js +217 -0
  174. package/esm/device/index.js.map +1 -0
  175. package/esm/device/os.d.ts +11 -0
  176. package/esm/device/os.js +28 -0
  177. package/esm/device/os.js.map +1 -0
  178. package/esm/file/createDir.d.ts +5 -0
  179. package/esm/file/createDir.js +13 -0
  180. package/esm/file/createDir.js.map +1 -0
  181. package/esm/file/fileMove.d.ts +4 -0
  182. package/esm/file/fileMove.js +29 -0
  183. package/esm/file/fileMove.js.map +1 -0
  184. package/esm/file/findFilesByExt.d.ts +13 -0
  185. package/esm/file/findFilesByExt.js +46 -0
  186. package/esm/file/findFilesByExt.js.map +1 -0
  187. package/esm/file/index.d.ts +9 -0
  188. package/esm/file/index.js +6 -0
  189. package/esm/file/index.js.map +1 -0
  190. package/esm/images/index.d.ts +2 -0
  191. package/esm/images/index.js +4 -0
  192. package/esm/images/index.js.map +1 -0
  193. package/esm/images/loadImage.d.ts +1 -0
  194. package/esm/images/loadImage.js +15 -0
  195. package/esm/images/loadImage.js.map +1 -0
  196. package/esm/images/resize.d.ts +2 -0
  197. package/esm/images/resize.js +31 -0
  198. package/esm/images/resize.js.map +1 -0
  199. package/esm/images/upload.d.ts +10 -0
  200. package/esm/images/upload.js +20 -0
  201. package/esm/images/upload.js.map +1 -0
  202. package/esm/index.d.ts +37 -0
  203. package/esm/index.js +38 -0
  204. package/esm/index.js.map +1 -0
  205. package/esm/json.d.ts +8 -0
  206. package/esm/json.js +28 -0
  207. package/esm/json.js.map +1 -0
  208. package/esm/math/diffDate.d.ts +5 -0
  209. package/esm/math/diffDate.js +10 -0
  210. package/esm/math/diffDate.js.map +1 -0
  211. package/esm/math/index.d.ts +30 -0
  212. package/esm/math/index.js +78 -0
  213. package/esm/math/index.js.map +1 -0
  214. package/esm/math/positiveNumber.d.ts +2 -0
  215. package/esm/math/positiveNumber.js +13 -0
  216. package/esm/math/positiveNumber.js.map +1 -0
  217. package/esm/name/en.d.ts +5 -0
  218. package/esm/name/en.js +22 -0
  219. package/esm/name/en.js.map +1 -0
  220. package/esm/name/index.d.ts +12 -0
  221. package/esm/name/index.js +6 -0
  222. package/esm/name/index.js.map +1 -0
  223. package/esm/name/vi.d.ts +5 -0
  224. package/esm/name/vi.js +24 -0
  225. package/esm/name/vi.js.map +1 -0
  226. package/{dist/object-43aaaf92.d.ts → esm/object.d.ts} +9 -30
  227. package/esm/object.js +70 -0
  228. package/esm/object.js.map +1 -0
  229. package/esm/permission/index.d.ts +8 -0
  230. package/esm/permission/index.js +5 -0
  231. package/esm/permission/index.js.map +1 -0
  232. package/esm/permission/requestCamera.d.ts +5 -0
  233. package/esm/permission/requestCamera.js +39 -0
  234. package/esm/permission/requestCamera.js.map +1 -0
  235. package/esm/permission/requestDeviceOrientationControl.d.ts +2 -0
  236. package/esm/permission/requestDeviceOrientationControl.js +35 -0
  237. package/esm/permission/requestDeviceOrientationControl.js.map +1 -0
  238. package/esm/response/index.d.ts +49 -0
  239. package/esm/response/index.js +46 -0
  240. package/esm/response/index.js.map +1 -0
  241. package/esm/string/formatNumber.d.ts +6 -0
  242. package/esm/string/formatNumber.js +11 -0
  243. package/esm/string/formatNumber.js.map +1 -0
  244. package/esm/string/generatePassword.d.ts +9 -0
  245. package/esm/string/generatePassword.js +20 -0
  246. package/esm/string/generatePassword.js.map +1 -0
  247. package/esm/string/generateUUID.d.ts +2 -0
  248. package/esm/string/generateUUID.js +33 -0
  249. package/esm/string/generateUUID.js.map +1 -0
  250. package/esm/string/index.d.ts +65 -0
  251. package/esm/string/index.js +150 -0
  252. package/esm/string/index.js.map +1 -0
  253. package/esm/string/makeDaySlug.d.ts +31 -0
  254. package/esm/string/makeDaySlug.js +16 -0
  255. package/esm/string/makeDaySlug.js.map +1 -0
  256. package/esm/string/random.d.ts +14 -0
  257. package/esm/string/random.js +20 -0
  258. package/esm/string/random.js.map +1 -0
  259. package/esm/string/trimNull.d.ts +2 -0
  260. package/esm/string/trimNull.js +14 -0
  261. package/esm/string/trimNull.js.map +1 -0
  262. package/esm/string/url.d.ts +36 -0
  263. package/esm/string/url.js +97 -0
  264. package/esm/string/url.js.map +1 -0
  265. package/package.json +1 -1
  266. package/src/console/index.ts +2 -2
  267. package/src/string/url.ts +2 -2
  268. package/dist/Checker.mjs +0 -29
  269. package/dist/EventDispatcher.mjs +0 -54
  270. package/dist/FileUpload.mjs +0 -62
  271. package/dist/Slug.mjs +0 -331
  272. package/dist/Timer-7b0c4e7c.d.ts +0 -11
  273. package/dist/Timer.mjs +0 -7
  274. package/dist/Validation.mjs +0 -35
  275. package/dist/array-dc599632.d.ts +0 -158
  276. package/dist/array.mjs +0 -49
  277. package/dist/browser-8d042ffe.d.ts +0 -22
  278. package/dist/camera-1a859d72.d.ts +0 -15
  279. package/dist/chunk-5NTK5JAI.mjs +0 -57
  280. package/dist/chunk-5UEMANWE.mjs +0 -91
  281. package/dist/chunk-5ZOWNKSD.mjs +0 -166
  282. package/dist/chunk-6GNGTFNC.mjs +0 -118
  283. package/dist/chunk-7MK72U4O.mjs +0 -19
  284. package/dist/chunk-7XKT3AQX.mjs +0 -17
  285. package/dist/chunk-7ZCEZM7K.mjs +0 -41
  286. package/dist/chunk-AMBWJGSW.mjs +0 -151
  287. package/dist/chunk-C7S43KGB.mjs +0 -15
  288. package/dist/chunk-CJM7T7ON.mjs +0 -24
  289. package/dist/chunk-CKILLYAP.mjs +0 -16
  290. package/dist/chunk-DX7MUT3M.mjs +0 -51
  291. package/dist/chunk-EGUJQ5VF.mjs +0 -32
  292. package/dist/chunk-ETEIHDWU.mjs +0 -25
  293. package/dist/chunk-FJXSVGL7.mjs +0 -22
  294. package/dist/chunk-GJCAEOND.mjs +0 -20
  295. package/dist/chunk-GNJDIUYM.mjs +0 -40
  296. package/dist/chunk-IA7GINWD.mjs +0 -39
  297. package/dist/chunk-JEI7BOXY.mjs +0 -21
  298. package/dist/chunk-K4KENOE6.mjs +0 -20
  299. package/dist/chunk-KMERW6KS.mjs +0 -34
  300. package/dist/chunk-KPO3RH5G.mjs +0 -27
  301. package/dist/chunk-KWG5LYNK.mjs +0 -100
  302. package/dist/chunk-NUTQDHLQ.mjs +0 -40
  303. package/dist/chunk-O64XUDAH.mjs +0 -35
  304. package/dist/chunk-OYRPWQUA.mjs +0 -257
  305. package/dist/chunk-PNZ4KGXL.mjs +0 -56
  306. package/dist/chunk-QZYX26HT.mjs +0 -24
  307. package/dist/chunk-RDGP2CKM.mjs +0 -195
  308. package/dist/chunk-VFG5VU6S.mjs +0 -12
  309. package/dist/chunk-X3IMFCZG.mjs +0 -23
  310. package/dist/chunk-ZHNGZMRD.mjs +0 -17
  311. package/dist/color.mjs +0 -78
  312. package/dist/console/enableConsole.mjs +0 -9
  313. package/dist/console/index.mjs +0 -14
  314. package/dist/console/log.mjs +0 -19
  315. package/dist/createDir-220e0081.d.ts +0 -13
  316. package/dist/device/browser.mjs +0 -15
  317. package/dist/device/camera.mjs +0 -8
  318. package/dist/device/index.mjs +0 -15
  319. package/dist/device/os.mjs +0 -33
  320. package/dist/enableConsole-ddc24282.d.ts +0 -11
  321. package/dist/file/createDir.mjs +0 -7
  322. package/dist/file/fileMove.mjs +0 -7
  323. package/dist/file/findFilesByExt.mjs +0 -11
  324. package/dist/file/index.mjs +0 -17
  325. package/dist/fileMove-3a09e429.d.ts +0 -13
  326. package/dist/findFilesByExt-753e91d7.d.ts +0 -24
  327. package/dist/images/index.mjs +0 -15
  328. package/dist/images/loadImage.mjs +0 -21
  329. package/dist/images/resize.mjs +0 -9
  330. package/dist/images/upload.mjs +0 -14
  331. package/dist/index-1f738e52.d.ts +0 -22
  332. package/dist/index-22309f0c.d.ts +0 -23
  333. package/dist/index-6ae3c86b.d.ts +0 -63
  334. package/dist/index-c8fffc86.d.ts +0 -90
  335. package/dist/index-d652ed2c.d.ts +0 -26
  336. package/dist/index.mjs +0 -87
  337. package/dist/json.mjs +0 -29
  338. package/dist/math/diffDate.mjs +0 -9
  339. package/dist/math/index.mjs +0 -34
  340. package/dist/math/positiveNumber.mjs +0 -10
  341. package/dist/name/en.mjs +0 -9
  342. package/dist/name/index.mjs +0 -20
  343. package/dist/name/vi.mjs +0 -14
  344. package/dist/object.mjs +0 -21
  345. package/dist/permission/index.mjs +0 -15
  346. package/dist/permission/requestCamera.mjs +0 -9
  347. package/dist/permission/requestDeviceOrientationControl.mjs +0 -10
  348. package/dist/requestCamera-32b7dfc7.d.ts +0 -14
  349. package/dist/requestDeviceOrientationControl-b6458660.d.ts +0 -11
  350. package/dist/response/index.mjs +0 -16
  351. package/dist/string/formatNumber.mjs +0 -10
  352. package/dist/string/generatePassword.mjs +0 -10
  353. package/dist/string/generateUUID.mjs +0 -9
  354. package/dist/string/index.mjs +0 -31
  355. package/dist/string/makeDaySlug.mjs +0 -9
  356. package/dist/string/random.mjs +0 -19
  357. package/dist/string/trimNull.mjs +0 -9
  358. package/dist/string/url.mjs +0 -22
  359. package/dist/url-60657387.d.ts +0 -57
@@ -1,56 +0,0 @@
1
- import {
2
- __export,
3
- __require
4
- } from "./chunk-ZHNGZMRD.mjs";
5
-
6
- // src/file/findFilesByExt.ts
7
- var findFilesByExt_exports = {};
8
- __export(findFilesByExt_exports, {
9
- default: () => findFilesByExt_default,
10
- findFileByExt: () => findFileByExt,
11
- forEachFileByExt: () => forEachFileByExt
12
- });
13
- var path = __require("path");
14
- var fs = __require("fs");
15
- var forEachFileByExt = (base, ext, cb) => {
16
- var walk = function(directoryName) {
17
- try {
18
- fs.readdir(directoryName, function(e, files) {
19
- if (e) {
20
- console.log("Error: ", e);
21
- return;
22
- }
23
- files.forEach(function(file) {
24
- var fullPath = path.join(directoryName, file);
25
- fs.stat(fullPath, function(e2, f) {
26
- if (e2) {
27
- console.log("Error: ", e2);
28
- return;
29
- }
30
- if (f.isDirectory()) {
31
- walk(fullPath);
32
- } else {
33
- if (fullPath.toLowerCase().indexOf(ext.toLowerCase()) > -1) {
34
- if (cb)
35
- cb(fullPath);
36
- }
37
- }
38
- });
39
- });
40
- });
41
- } catch (error) {
42
- console.log("error", error);
43
- }
44
- };
45
- walk(base);
46
- };
47
- var findFileByExt = forEachFileByExt;
48
- var fileExt = { findFileByExt, forEachFileByExt };
49
- var findFilesByExt_default = fileExt;
50
-
51
- export {
52
- forEachFileByExt,
53
- findFileByExt,
54
- findFilesByExt_default,
55
- findFilesByExt_exports
56
- };
@@ -1,24 +0,0 @@
1
- import {
2
- numeric,
3
- punctuation,
4
- randomStringByLength,
5
- textLowCase
6
- } from "./chunk-KPO3RH5G.mjs";
7
-
8
- // src/string/generatePassword.ts
9
- function generatePassword(length = 6, hard = true) {
10
- if (!Number.isFinite(length))
11
- length = 6;
12
- if (length <= 0)
13
- length = 6;
14
- let pass = randomStringByLength(length, textLowCase + textLowCase.toUpperCase() + numeric);
15
- if (hard)
16
- pass = pass.replace(pass[Math.floor(pass.length / 2)], randomStringByLength(1, punctuation));
17
- return pass;
18
- }
19
- var generatePassword_default = generatePassword;
20
-
21
- export {
22
- generatePassword,
23
- generatePassword_default
24
- };
@@ -1,195 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-ZHNGZMRD.mjs";
4
-
5
- // src/device/index.ts
6
- var device_exports = {};
7
- __export(device_exports, {
8
- checkOS: () => checkOS,
9
- isAndroid: () => isAndroid,
10
- isIos: () => isIos,
11
- isMobile: () => isMobile,
12
- isTablet: () => isTablet
13
- });
14
- var isIos = () => {
15
- const deviceInfo2 = checkOS();
16
- if (deviceInfo2)
17
- return deviceInfo2.os.toLowerCase() == "ios";
18
- console.log("Can't check OS");
19
- return null;
20
- };
21
- var isAndroid = () => {
22
- const deviceInfo2 = checkOS();
23
- if (deviceInfo2)
24
- return deviceInfo2.os.toLowerCase() == "android";
25
- console.log("Can't check OS");
26
- return null;
27
- };
28
- var isTablet = () => {
29
- if (typeof navigator == "undefined")
30
- return null;
31
- if (typeof window == "undefined")
32
- return null;
33
- return isMobile() && window.innerWidth > 599 && window.innerHeight > 599;
34
- };
35
- var isMobile = () => {
36
- if (typeof navigator == "undefined")
37
- return null;
38
- if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {
39
- return true;
40
- } else {
41
- return false;
42
- }
43
- };
44
- var deviceInfo;
45
- var checkOS = () => {
46
- var _a;
47
- if (typeof window == "undefined")
48
- return {};
49
- if (typeof deviceInfo == "undefined") {
50
- var unknown = "-";
51
- var screenSize = "";
52
- if (screen.width) {
53
- var width = screen.width ? screen.width : "";
54
- var height = screen.height ? screen.height : "";
55
- screenSize += "" + width + " x " + height;
56
- }
57
- var nVer = navigator.appVersion;
58
- var nAgt = navigator.userAgent;
59
- var browser = navigator.appName;
60
- var version = "" + parseFloat(navigator.appVersion);
61
- var majorVersion = parseInt(navigator.appVersion, 10);
62
- var nameOffset, verOffset, ix;
63
- if ((verOffset = nAgt.indexOf("Opera")) != -1) {
64
- browser = "Opera";
65
- version = nAgt.substring(verOffset + 6);
66
- if ((verOffset = nAgt.indexOf("Version")) != -1) {
67
- version = nAgt.substring(verOffset + 8);
68
- }
69
- }
70
- if ((verOffset = nAgt.indexOf("OPR")) != -1) {
71
- browser = "Opera";
72
- version = nAgt.substring(verOffset + 4);
73
- } else if ((verOffset = nAgt.indexOf("Edge")) != -1) {
74
- browser = "Microsoft Edge";
75
- version = nAgt.substring(verOffset + 5);
76
- } else if ((verOffset = nAgt.indexOf("MSIE")) != -1) {
77
- browser = "Microsoft Internet Explorer";
78
- version = nAgt.substring(verOffset + 5);
79
- } else if ((verOffset = nAgt.indexOf("Chrome")) != -1) {
80
- browser = "Chrome";
81
- version = nAgt.substring(verOffset + 7);
82
- } else if ((verOffset = nAgt.indexOf("Safari")) != -1) {
83
- browser = "Safari";
84
- version = nAgt.substring(verOffset + 7);
85
- if ((verOffset = nAgt.indexOf("Version")) != -1) {
86
- version = nAgt.substring(verOffset + 8);
87
- }
88
- } else if ((verOffset = nAgt.indexOf("Firefox")) != -1) {
89
- browser = "Firefox";
90
- version = nAgt.substring(verOffset + 8);
91
- } else if (nAgt.indexOf("Trident/") != -1) {
92
- browser = "Microsoft Internet Explorer";
93
- version = nAgt.substring(nAgt.indexOf("rv:") + 3);
94
- } else if ((nameOffset = nAgt.lastIndexOf(" ") + 1) < (verOffset = nAgt.lastIndexOf("/"))) {
95
- browser = nAgt.substring(nameOffset, verOffset);
96
- version = nAgt.substring(verOffset + 1);
97
- if (browser.toLowerCase() == browser.toUpperCase()) {
98
- browser = navigator.appName;
99
- }
100
- }
101
- if ((ix = version.indexOf(";")) != -1)
102
- version = version.substring(0, ix);
103
- if ((ix = version.indexOf(" ")) != -1)
104
- version = version.substring(0, ix);
105
- if ((ix = version.indexOf(")")) != -1)
106
- version = version.substring(0, ix);
107
- majorVersion = parseInt("" + version, 10);
108
- if (isNaN(majorVersion)) {
109
- version = "" + parseFloat(navigator.appVersion);
110
- majorVersion = parseInt(navigator.appVersion, 10);
111
- }
112
- var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
113
- var cookieEnabled = navigator.cookieEnabled ? true : false;
114
- if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
115
- document.cookie = "testcookie";
116
- cookieEnabled = document.cookie.indexOf("testcookie") != -1 ? true : false;
117
- }
118
- var os = unknown;
119
- var clientStrings = [
120
- { s: "Windows 10", r: /(Windows 10.0|Windows NT 10.0)/ },
121
- { s: "Windows 8.1", r: /(Windows 8.1|Windows NT 6.3)/ },
122
- { s: "Windows 8", r: /(Windows 8|Windows NT 6.2)/ },
123
- { s: "Windows 7", r: /(Windows 7|Windows NT 6.1)/ },
124
- { s: "Windows Vista", r: /Windows NT 6.0/ },
125
- { s: "Windows Server 2003", r: /Windows NT 5.2/ },
126
- { s: "Windows XP", r: /(Windows NT 5.1|Windows XP)/ },
127
- { s: "Windows 2000", r: /(Windows NT 5.0|Windows 2000)/ },
128
- { s: "Windows ME", r: /(Win 9x 4.90|Windows ME)/ },
129
- { s: "Windows 98", r: /(Windows 98|Win98)/ },
130
- { s: "Windows 95", r: /(Windows 95|Win95|Windows_95)/ },
131
- { s: "Windows NT 4.0", r: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
132
- { s: "Windows CE", r: /Windows CE/ },
133
- { s: "Windows 3.11", r: /Win16/ },
134
- { s: "Android", r: /Android/ },
135
- { s: "Open BSD", r: /OpenBSD/ },
136
- { s: "Sun OS", r: /SunOS/ },
137
- { s: "Linux", r: /(Linux|X11)/ },
138
- { s: "iOS", r: /(iPhone|iPad|iPod)/ },
139
- { s: "Mac OS X", r: /Mac OS X/ },
140
- { s: "Mac OS", r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
141
- { s: "QNX", r: /QNX/ },
142
- { s: "UNIX", r: /UNIX/ },
143
- { s: "BeOS", r: /BeOS/ },
144
- { s: "OS/2", r: /OS\/2/ },
145
- { s: "Search Bot", r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
146
- ];
147
- for (var id in clientStrings) {
148
- var cs = clientStrings[id];
149
- if (cs.r.test(nAgt)) {
150
- os = cs.s;
151
- break;
152
- }
153
- }
154
- var osVersion = unknown;
155
- if (/Windows/.test(os)) {
156
- const _osv = /Windows (.*)/.exec(os) || [];
157
- osVersion = _osv[1] || "unknown";
158
- os = "Windows";
159
- }
160
- switch (os) {
161
- case "Mac OS X":
162
- const _osvx = /Mac OS X (10[\.\_\d]+)/.exec(nAgt);
163
- osVersion = (_osvx == null ? void 0 : _osvx[1]) || "unknown";
164
- break;
165
- case "Android":
166
- osVersion = ((_a = /Android ([\.\_\d]+)/.exec(nAgt)) == null ? void 0 : _a[1]) || "unknown";
167
- break;
168
- case "iOS":
169
- const _osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer) || [0, 0, 0];
170
- osVersion = (_osVersion[1] || 0) + "." + (_osVersion[2] || 0) + "." + (_osVersion[3] || 0);
171
- break;
172
- }
173
- const _deviceInfo = {
174
- screen: screenSize,
175
- browser,
176
- browserVersion: version,
177
- browserMajorVersion: majorVersion,
178
- mobile,
179
- os,
180
- osVersion,
181
- cookies: cookieEnabled
182
- };
183
- deviceInfo = _deviceInfo;
184
- }
185
- return deviceInfo;
186
- };
187
-
188
- export {
189
- isIos,
190
- isAndroid,
191
- isTablet,
192
- isMobile,
193
- checkOS,
194
- device_exports
195
- };
@@ -1,12 +0,0 @@
1
- // src/math/diffDate.ts
2
- function diffDate(date1, date2) {
3
- date1 = date1 || new Date().toString();
4
- date2 = date2 || new Date().toString();
5
- return (new Date(date2).getTime() - new Date(date1).getTime()) / (24 * 60 * 60 * 1e3);
6
- }
7
- var diffDate_default = diffDate;
8
-
9
- export {
10
- diffDate,
11
- diffDate_default
12
- };
@@ -1,23 +0,0 @@
1
- import {
2
- __export,
3
- __require
4
- } from "./chunk-ZHNGZMRD.mjs";
5
-
6
- // src/file/createDir.ts
7
- var createDir_exports = {};
8
- __export(createDir_exports, {
9
- createDir: () => createDir
10
- });
11
- var fs = __require("fs");
12
- function createDir(path) {
13
- if (fs.existsSync(path)) {
14
- console.log("directory already exited !");
15
- return true;
16
- }
17
- fs.mkdirSync(path, { recursive: true });
18
- }
19
-
20
- export {
21
- createDir,
22
- createDir_exports
23
- };
@@ -1,17 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined")
6
- return require.apply(this, arguments);
7
- throw new Error('Dynamic require of "' + x + '" is not supported');
8
- });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
-
14
- export {
15
- __require,
16
- __export
17
- };
package/dist/color.mjs DELETED
@@ -1,78 +0,0 @@
1
- import "./chunk-ZHNGZMRD.mjs";
2
-
3
- // src/color.ts
4
- var random = (hex = false) => {
5
- return (hex ? "#" : "") + Math.floor(Math.random() * 16777215).toString(16);
6
- };
7
- var pSBC = (p, c0, c1, l) => {
8
- let r, g, b, P, f, t, h, i = parseInt, m = Math.round, a = typeof c1 == "string";
9
- if (typeof p != "number" || p < -1 || p > 1 || typeof c0 != "string" || c0[0] != "r" && c0[0] != "#" || c1 && !a)
10
- return null;
11
- const pSBCr = (d) => {
12
- let n = d.length, x = { r: 0, g: 0, b: 0, a: 1 };
13
- if (n > 9) {
14
- [r, g, b, a] = d = d.split(","), n = d.length;
15
- if (n < 3 || n > 4)
16
- return null;
17
- x.r = i(r[3] == "a" ? r.slice(5) : r.slice(4)), x.g = i(g), x.b = i(b), x.a = a ? parseFloat(a.toString()) : -1;
18
- } else {
19
- if (n == 8 || n == 6 || n < 4)
20
- return null;
21
- if (n < 6)
22
- d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : "");
23
- d = i(d.slice(1), 16);
24
- if (n == 9 || n == 5)
25
- x.r = d >> 24 & 255, x.g = d >> 16 & 255, x.b = d >> 8 & 255, x.a = m((d & 255) / 0.255) / 1e3;
26
- else
27
- x.r = d >> 16, x.g = d >> 8 & 255, x.b = d & 255, x.a = -1;
28
- }
29
- return x;
30
- };
31
- h = c0.length > 9, h = a ? c1.length > 9 ? true : c1 == "c" ? !h : false : h, f = pSBCr(c0), P = p < 0, t = c1 && c1 != "c" ? pSBCr(c1) : P ? { r: 0, g: 0, b: 0, a: -1 } : { r: 255, g: 255, b: 255, a: -1 }, p = P ? p * -1 : p, P = 1 - p;
32
- if (!f || !t || typeof f == "undefined")
33
- return null;
34
- else if (l)
35
- r = m(P * f.r + p * t.r), g = m(P * f.g + p * t.g), b = m(P * f.b + p * t.b);
36
- else
37
- r = m((P * f.r ** 2 + p * t.r ** 2) ** 0.5), g = m((P * f.g ** 2 + p * t.g ** 2) ** 0.5), b = m((P * f.b ** 2 + p * t.b ** 2) ** 0.5);
38
- a = f.a, t = t.a, f = a >= 0 || t >= 0, a = f ? a < 0 ? t : t < 0 ? a : a * P + t * p : 0;
39
- if (h)
40
- return "rgb" + (f ? "a(" : "(") + r + "," + g + "," + b + (f ? "," + m(a * 1e3) / 1e3 : "") + ")";
41
- else
42
- return "#" + (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)).toString(16).slice(1, f ? void 0 : -2);
43
- };
44
- var hexToRgb = (hex) => {
45
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
46
- return result ? {
47
- r: parseInt(result[1], 16),
48
- g: parseInt(result[2], 16),
49
- b: parseInt(result[3], 16)
50
- } : null;
51
- };
52
- var hexDarken = (hex, amount) => {
53
- return pSBC(-amount, hex);
54
- };
55
- var hexLighten = (hex, amount) => {
56
- return pSBC(amount, hex);
57
- };
58
- var RGBToHex = (rgb) => {
59
- return pSBC(0, rgb, "c", true);
60
- };
61
- var color = {
62
- random,
63
- pSBC,
64
- hexToRgb,
65
- hexDarken,
66
- hexLighten,
67
- RGBToHex
68
- };
69
- var color_default = color;
70
- export {
71
- RGBToHex,
72
- color_default as default,
73
- hexDarken,
74
- hexLighten,
75
- hexToRgb,
76
- pSBC,
77
- random
78
- };
@@ -1,9 +0,0 @@
1
- import {
2
- enableConsole,
3
- enableConsole_default
4
- } from "../chunk-FJXSVGL7.mjs";
5
- import "../chunk-ZHNGZMRD.mjs";
6
- export {
7
- enableConsole_default as default,
8
- enableConsole
9
- };
@@ -1,14 +0,0 @@
1
- import {
2
- console_default,
3
- disableConsole,
4
- removeConsole,
5
- showCredit
6
- } from "../chunk-O64XUDAH.mjs";
7
- import "../chunk-FJXSVGL7.mjs";
8
- import "../chunk-ZHNGZMRD.mjs";
9
- export {
10
- console_default as default,
11
- disableConsole,
12
- removeConsole,
13
- showCredit
14
- };
@@ -1,19 +0,0 @@
1
- import {
2
- log,
3
- logError,
4
- logFull,
5
- logRes,
6
- logSuccess,
7
- logWarn,
8
- log_default
9
- } from "../chunk-GNJDIUYM.mjs";
10
- import "../chunk-ZHNGZMRD.mjs";
11
- export {
12
- log_default as default,
13
- log,
14
- logError,
15
- logFull,
16
- logRes,
17
- logSuccess,
18
- logWarn
19
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Create new directory
3
- */
4
- declare function createDir(path: string): true | undefined;
5
-
6
- declare const createDir$1_createDir: typeof createDir;
7
- declare namespace createDir$1 {
8
- export {
9
- createDir$1_createDir as createDir,
10
- };
11
- }
12
-
13
- export { createDir as a, createDir$1 as c };
@@ -1,15 +0,0 @@
1
- import {
2
- isFacebookWebview,
3
- isInAppWebview,
4
- isLandscape,
5
- isPotrait,
6
- ua
7
- } from "../chunk-DX7MUT3M.mjs";
8
- import "../chunk-ZHNGZMRD.mjs";
9
- export {
10
- isFacebookWebview,
11
- isInAppWebview,
12
- isLandscape,
13
- isPotrait,
14
- ua
15
- };
@@ -1,8 +0,0 @@
1
- import {
2
- getWebcam
3
- } from "../chunk-AMBWJGSW.mjs";
4
- import "../chunk-NUTQDHLQ.mjs";
5
- import "../chunk-ZHNGZMRD.mjs";
6
- export {
7
- getWebcam
8
- };
@@ -1,15 +0,0 @@
1
- import {
2
- checkOS,
3
- isAndroid,
4
- isIos,
5
- isMobile,
6
- isTablet
7
- } from "../chunk-RDGP2CKM.mjs";
8
- import "../chunk-ZHNGZMRD.mjs";
9
- export {
10
- checkOS,
11
- isAndroid,
12
- isIos,
13
- isMobile,
14
- isTablet
15
- };
@@ -1,33 +0,0 @@
1
- import "../chunk-ZHNGZMRD.mjs";
2
-
3
- // src/device/os.ts
4
- import os from "os";
5
- function getOS() {
6
- const osvar = os.platform();
7
- if (osvar == "darwin") {
8
- return "mac";
9
- } else if (osvar == "win32") {
10
- return "win";
11
- } else if (osvar == "linux") {
12
- return "linux";
13
- } else {
14
- return osvar;
15
- }
16
- }
17
- function isWin() {
18
- return os.platform() == "win32";
19
- }
20
- function isMac() {
21
- return os.platform() == "darwin";
22
- }
23
- function isLinux() {
24
- return os.platform() == "linux";
25
- }
26
- var os_default = { getOS, isWin, isMac, isLinux };
27
- export {
28
- os_default as default,
29
- getOS,
30
- isLinux,
31
- isMac,
32
- isWin
33
- };
@@ -1,11 +0,0 @@
1
- declare function enableConsole(): Console;
2
-
3
- declare const enableConsole$1_enableConsole: typeof enableConsole;
4
- declare namespace enableConsole$1 {
5
- export {
6
- enableConsole as default,
7
- enableConsole$1_enableConsole as enableConsole,
8
- };
9
- }
10
-
11
- export { enableConsole as a, enableConsole$1 as e };
@@ -1,7 +0,0 @@
1
- import {
2
- createDir
3
- } from "../chunk-X3IMFCZG.mjs";
4
- import "../chunk-ZHNGZMRD.mjs";
5
- export {
6
- createDir
7
- };
@@ -1,7 +0,0 @@
1
- import {
2
- fileMove
3
- } from "../chunk-IA7GINWD.mjs";
4
- import "../chunk-ZHNGZMRD.mjs";
5
- export {
6
- fileMove
7
- };
@@ -1,11 +0,0 @@
1
- import {
2
- findFileByExt,
3
- findFilesByExt_default,
4
- forEachFileByExt
5
- } from "../chunk-PNZ4KGXL.mjs";
6
- import "../chunk-ZHNGZMRD.mjs";
7
- export {
8
- findFilesByExt_default as default,
9
- findFileByExt,
10
- forEachFileByExt
11
- };
@@ -1,17 +0,0 @@
1
- import {
2
- createDir
3
- } from "../chunk-X3IMFCZG.mjs";
4
- import {
5
- fileMove
6
- } from "../chunk-IA7GINWD.mjs";
7
- import {
8
- findFilesByExt_default
9
- } from "../chunk-PNZ4KGXL.mjs";
10
- import "../chunk-ZHNGZMRD.mjs";
11
-
12
- // src/file/index.ts
13
- var xfile = { createDir, fileMove, ...findFilesByExt_default };
14
- var file_default = xfile;
15
- export {
16
- file_default as default
17
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Move file to another location.
3
- */
4
- declare function fileMove(oldPath: string, newPath: string, callback: any): void;
5
-
6
- declare const fileMove$1_fileMove: typeof fileMove;
7
- declare namespace fileMove$1 {
8
- export {
9
- fileMove$1_fileMove as fileMove,
10
- };
11
- }
12
-
13
- export { fileMove as a, fileMove$1 as f };
@@ -1,24 +0,0 @@
1
- /**
2
- * This is an alias of "findFileByExt()"
3
- */
4
- declare const forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
5
- /**
6
- * This is an alias of "forEachFileByExt()"
7
- */
8
- declare const findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
9
- declare const fileExt: {
10
- findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
11
- forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
12
- };
13
-
14
- declare const findFilesByExt_findFileByExt: typeof findFileByExt;
15
- declare const findFilesByExt_forEachFileByExt: typeof forEachFileByExt;
16
- declare namespace findFilesByExt {
17
- export {
18
- fileExt as default,
19
- findFilesByExt_findFileByExt as findFileByExt,
20
- findFilesByExt_forEachFileByExt as forEachFileByExt,
21
- };
22
- }
23
-
24
- export { fileExt as a, forEachFileByExt as b, findFileByExt as c, findFilesByExt as f };
@@ -1,15 +0,0 @@
1
- import {
2
- upload
3
- } from "../chunk-EGUJQ5VF.mjs";
4
- import "../chunk-5NTK5JAI.mjs";
5
- import {
6
- resize
7
- } from "../chunk-KMERW6KS.mjs";
8
- import "../chunk-GNJDIUYM.mjs";
9
- import "../chunk-KWG5LYNK.mjs";
10
- import "../chunk-5UEMANWE.mjs";
11
- import "../chunk-ZHNGZMRD.mjs";
12
- export {
13
- resize,
14
- upload
15
- };