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,40 +1,37 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/string/generateUUID.ts
21
- var generateUUID_exports = {};
22
- __export(generateUUID_exports, {
23
- default: () => generateUUID_default,
24
- generateUUID: () => generateUUID
25
- });
26
- module.exports = __toCommonJS(generateUUID_exports);
27
- var _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
28
- function generateUUID() {
29
- const d0 = Math.random() * 4294967295 | 0;
30
- const d1 = Math.random() * 4294967295 | 0;
31
- const d2 = Math.random() * 4294967295 | 0;
32
- const d3 = Math.random() * 4294967295 | 0;
33
- const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
34
- return uuid.toLowerCase();
35
- }
36
- var generateUUID_default = generateUUID;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- generateUUID
40
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateUUID = void 0;
4
+ //prettier-ignore
5
+ const _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];
6
+ function generateUUID() {
7
+ // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
8
+ const d0 = (Math.random() * 0xffffffff) | 0;
9
+ const d1 = (Math.random() * 0xffffffff) | 0;
10
+ const d2 = (Math.random() * 0xffffffff) | 0;
11
+ const d3 = (Math.random() * 0xffffffff) | 0;
12
+ const uuid = _lut[d0 & 0xff] +
13
+ _lut[(d0 >> 8) & 0xff] +
14
+ _lut[(d0 >> 16) & 0xff] +
15
+ _lut[(d0 >> 24) & 0xff] +
16
+ "-" +
17
+ _lut[d1 & 0xff] +
18
+ _lut[(d1 >> 8) & 0xff] +
19
+ "-" +
20
+ _lut[((d1 >> 16) & 0x0f) | 0x40] +
21
+ _lut[(d1 >> 24) & 0xff] +
22
+ "-" +
23
+ _lut[(d2 & 0x3f) | 0x80] +
24
+ _lut[(d2 >> 8) & 0xff] +
25
+ "-" +
26
+ _lut[(d2 >> 16) & 0xff] +
27
+ _lut[(d2 >> 24) & 0xff] +
28
+ _lut[d3 & 0xff] +
29
+ _lut[(d3 >> 8) & 0xff] +
30
+ _lut[(d3 >> 16) & 0xff] +
31
+ _lut[(d3 >> 24) & 0xff];
32
+ // .toLowerCase() here flattens concatenated strings to save heap memory space.
33
+ return uuid.toLowerCase();
34
+ }
35
+ exports.generateUUID = generateUUID;
36
+ exports.default = generateUUID;
37
+ //# sourceMappingURL=generateUUID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateUUID.js","sourceRoot":"","sources":["../../src/string/generateUUID.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;A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,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,GAAG;QACH,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;QACf,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QACtB,GAAG;QACH,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,GAAG;QACH,IAAI,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QACtB,GAAG;QACH,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;QACf,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAEzB,+EAA+E;IAC/E,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC;AA/BD,oCA+BC;AAED,kBAAe,YAAY,CAAC"}
@@ -1,6 +1,65 @@
1
- import './makeDaySlug.js';
2
- import './generateUUID.js';
3
- import './formatNumber.js';
4
- import './generatePassword.js';
5
- import './trimNull.js';
6
- export { c as capitalize, d as capitalizeName, e as clearUnicodeCharacters, x as default, g as getBetween, m as makeString, b as titleize, a as toLowerCase, t as toUpperCase } from '../index-c8fffc86.js';
1
+ /**
2
+ * Get string between str1 and str2 from text
3
+ */
4
+ export declare const getBetween: (text: string, str1: string, str2?: string) => string;
5
+ /**
6
+ * Convert object to string
7
+ */
8
+ export declare const makeString: (object?: any) => string;
9
+ /**
10
+ * toUpperCase
11
+ */
12
+ export declare const toUpperCase: (str?: string) => string;
13
+ /**
14
+ * toLowerCase
15
+ */
16
+ export declare const toLowerCase: (str?: string) => string;
17
+ /**
18
+ * toLowerCase
19
+ * @param {*} str
20
+ * @return {string}
21
+ */
22
+ export declare const titleize: (str?: string) => string;
23
+ /**
24
+ * Convert only first charater to UpperCase
25
+ */
26
+ export declare const capitalize: (str: string | any, lowercaseRest?: number) => any;
27
+ /**
28
+ * Convert first character from every single words to UpperCase
29
+ */
30
+ export declare const capitalizeName: (str: string) => string;
31
+ export declare const clearUnicodeCharacters: (s: string, opt?: {
32
+ [key: string]: any;
33
+ }) => string;
34
+ import { makeDaySlug } from "./makeDaySlug";
35
+ import { generateUUID } from "./generateUUID";
36
+ import { formatNumber } from "./formatNumber";
37
+ import { generatePassword } from "./generatePassword";
38
+ import { trimNull } from "./trimNull";
39
+ declare const xstring: {
40
+ getBetween: (text: string, str1: string, str2?: string) => string;
41
+ makeString: (object?: any) => string;
42
+ makeDaySlug: typeof makeDaySlug;
43
+ toUpperCase: (str?: string) => string;
44
+ toLowerCase: (str?: string) => string;
45
+ titleize: (str?: string) => string;
46
+ capitalize: (str: string | any, lowercaseRest?: number) => any;
47
+ capitalizeName: (str: string) => string;
48
+ clearUnicodeCharacters: (s: string, opt?: {
49
+ [key: string]: any;
50
+ }) => string;
51
+ generateUUID: typeof generateUUID;
52
+ randAllCharacterByLength: (length?: number) => string;
53
+ randomStringByLength: (length: number, str?: string) => string;
54
+ formatNumber: typeof formatNumber;
55
+ generatePassword: typeof generatePassword;
56
+ trimNull: typeof trimNull;
57
+ addQueryParam: (_url: string, key: string, value: any) => string;
58
+ getUrlParams: (parameter: string, staticURL?: string | undefined, decode?: boolean) => string | false | undefined;
59
+ isLink: (str: string) => boolean;
60
+ getFileNameWithoutExtension: (url: string) => string | undefined;
61
+ getFileNameWithExtension: (url: string) => string;
62
+ getFileExtension: (url: string) => string | undefined;
63
+ isImage: (url: string) => boolean;
64
+ };
65
+ export default xstring;