diginext-utils 2.1.20 → 2.1.22

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 (205) hide show
  1. package/dist/Checker.d.ts +8 -8
  2. package/dist/Checker.js +31 -31
  3. package/dist/EventDispatcher.d.ts +13 -13
  4. package/dist/EventDispatcher.js +51 -51
  5. package/dist/FileUpload.d.ts +12 -12
  6. package/dist/FileUpload.js +64 -64
  7. package/dist/Slug.d.ts +9 -9
  8. package/dist/Slug.js +333 -333
  9. package/dist/Timer.d.ts +4 -4
  10. package/dist/Timer.js +8 -8
  11. package/dist/Validation.d.ts +5 -5
  12. package/dist/Validation.js +38 -38
  13. package/dist/array.d.ts +113 -113
  14. package/dist/array.js +297 -297
  15. package/dist/color.d.ts +25 -25
  16. package/dist/color.js +95 -95
  17. package/dist/console/enableConsole.d.ts +2 -2
  18. package/dist/console/enableConsole.js +13 -13
  19. package/dist/console/index.d.ts +11 -11
  20. package/dist/console/index.js +17 -17
  21. package/dist/console/log.d.ts +15 -15
  22. package/dist/console/log.js +44 -44
  23. package/dist/device/browser.d.ts +5 -5
  24. package/dist/device/browser.js +37 -37
  25. package/dist/device/camera.d.ts +7 -7
  26. package/dist/device/camera.js +171 -171
  27. package/dist/device/index.d.ts +5 -5
  28. package/dist/device/index.js +224 -224
  29. package/dist/device/os.d.ts +11 -11
  30. package/dist/device/os.js +37 -37
  31. package/dist/file/createDir.d.ts +5 -5
  32. package/dist/file/createDir.js +15 -15
  33. package/dist/file/fileMove.d.ts +4 -4
  34. package/dist/file/fileMove.js +32 -32
  35. package/dist/file/findFilesByExt.d.ts +13 -13
  36. package/dist/file/findFilesByExt.js +49 -49
  37. package/dist/file/getAllFiles.d.ts +1 -0
  38. package/dist/file/getAllFiles.js +27 -0
  39. package/dist/file/getAllFiles.js.map +1 -0
  40. package/dist/file/index.d.ts +9 -9
  41. package/dist/file/index.js +10 -10
  42. package/dist/gameboi/index.d.ts +10 -10
  43. package/dist/gameboi/index.js +67 -64
  44. package/dist/gameboi/index.js.map +1 -1
  45. package/dist/images/downloadByUrl.d.ts +1 -1
  46. package/dist/images/downloadByUrl.js +55 -55
  47. package/dist/images/index.d.ts +2 -2
  48. package/dist/images/index.js +8 -8
  49. package/dist/images/loadImage.d.ts +1 -1
  50. package/dist/images/loadImage.js +17 -17
  51. package/dist/images/resize.d.ts +2 -2
  52. package/dist/images/resize.js +37 -37
  53. package/dist/images/upload.d.ts +10 -10
  54. package/dist/images/upload.js +26 -26
  55. package/dist/index.d.ts +37 -37
  56. package/dist/index.js +62 -62
  57. package/dist/json.d.ts +8 -8
  58. package/dist/json.js +31 -31
  59. package/dist/math/diffDate.d.ts +5 -5
  60. package/dist/math/diffDate.js +13 -13
  61. package/dist/math/index.d.ts +30 -30
  62. package/dist/math/index.js +92 -92
  63. package/dist/math/positiveNumber.d.ts +2 -2
  64. package/dist/math/positiveNumber.js +16 -16
  65. package/dist/name/en.d.ts +5 -5
  66. package/dist/name/en.js +25 -25
  67. package/dist/name/index.d.ts +12 -12
  68. package/dist/name/index.js +12 -12
  69. package/dist/name/vi.d.ts +5 -5
  70. package/dist/name/vi.js +27 -27
  71. package/dist/object.d.ts +59 -59
  72. package/dist/object.js +79 -79
  73. package/dist/permission/index.d.ts +8 -8
  74. package/dist/permission/index.js +6 -6
  75. package/dist/permission/requestCamera.d.ts +5 -5
  76. package/dist/permission/requestCamera.js +42 -42
  77. package/dist/permission/requestDeviceOrientationControl.d.ts +2 -2
  78. package/dist/permission/requestDeviceOrientationControl.js +38 -38
  79. package/dist/response/index.d.ts +49 -49
  80. package/dist/response/index.js +51 -51
  81. package/dist/string/convertPathnameAndQuery.d.ts +4 -4
  82. package/dist/string/convertPathnameAndQuery.js +24 -24
  83. package/dist/string/formatNumber.d.ts +6 -6
  84. package/dist/string/formatNumber.js +14 -14
  85. package/dist/string/generatePassword.d.ts +9 -9
  86. package/dist/string/generatePassword.js +23 -23
  87. package/dist/string/generateUUID.d.ts +2 -2
  88. package/dist/string/generateUUID.js +36 -36
  89. package/dist/string/getTextBetweenCharByIndex.d.ts +1 -1
  90. package/dist/string/getTextBetweenCharByIndex.js +20 -20
  91. package/dist/string/index.d.ts +65 -65
  92. package/dist/string/index.js +161 -161
  93. package/dist/string/indexesOf.d.ts +1 -1
  94. package/dist/string/indexesOf.js +14 -14
  95. package/dist/string/makeDaySlug.d.ts +31 -31
  96. package/dist/string/makeDaySlug.js +22 -22
  97. package/dist/string/random.d.ts +18 -18
  98. package/dist/string/random.js +40 -40
  99. package/dist/string/trimNull.d.ts +2 -2
  100. package/dist/string/trimNull.js +20 -20
  101. package/dist/string/url.d.ts +22 -22
  102. package/dist/string/url.js +74 -74
  103. package/esm/Checker.d.ts +8 -8
  104. package/esm/Checker.js +27 -27
  105. package/esm/EventDispatcher.d.ts +13 -13
  106. package/esm/EventDispatcher.js +48 -48
  107. package/esm/FileUpload.d.ts +12 -12
  108. package/esm/FileUpload.js +61 -61
  109. package/esm/Slug.d.ts +9 -9
  110. package/esm/Slug.js +329 -329
  111. package/esm/Timer.d.ts +4 -4
  112. package/esm/Timer.js +6 -6
  113. package/esm/Validation.d.ts +5 -5
  114. package/esm/Validation.js +36 -36
  115. package/esm/array.d.ts +113 -113
  116. package/esm/array.js +275 -275
  117. package/esm/color.d.ts +25 -25
  118. package/esm/color.js +85 -85
  119. package/esm/console/enableConsole.d.ts +2 -2
  120. package/esm/console/enableConsole.js +6 -6
  121. package/esm/console/index.d.ts +11 -11
  122. package/esm/console/index.js +12 -12
  123. package/esm/console/log.d.ts +15 -15
  124. package/esm/console/log.js +32 -32
  125. package/esm/device/browser.d.ts +5 -5
  126. package/esm/device/browser.js +29 -29
  127. package/esm/device/camera.d.ts +7 -7
  128. package/esm/device/camera.js +167 -167
  129. package/esm/device/index.d.ts +5 -5
  130. package/esm/device/index.js +216 -216
  131. package/esm/device/os.d.ts +11 -11
  132. package/esm/device/os.js +27 -27
  133. package/esm/file/createDir.d.ts +5 -5
  134. package/esm/file/createDir.js +12 -12
  135. package/esm/file/fileMove.d.ts +4 -4
  136. package/esm/file/fileMove.js +28 -28
  137. package/esm/file/findFilesByExt.d.ts +13 -13
  138. package/esm/file/findFilesByExt.js +45 -45
  139. package/esm/file/getAllFiles.d.ts +1 -0
  140. package/esm/file/getAllFiles.js +21 -0
  141. package/esm/file/getAllFiles.js.map +1 -0
  142. package/esm/file/index.d.ts +9 -9
  143. package/esm/file/index.js +5 -5
  144. package/esm/gameboi/index.d.ts +10 -10
  145. package/esm/gameboi/index.js +61 -61
  146. package/esm/gameboi/index.js.map +1 -1
  147. package/esm/images/downloadByUrl.d.ts +1 -1
  148. package/esm/images/downloadByUrl.js +52 -52
  149. package/esm/images/index.d.ts +2 -2
  150. package/esm/images/index.js +3 -3
  151. package/esm/images/loadImage.d.ts +1 -1
  152. package/esm/images/loadImage.js +14 -14
  153. package/esm/images/resize.d.ts +2 -2
  154. package/esm/images/resize.js +30 -30
  155. package/esm/images/upload.d.ts +10 -10
  156. package/esm/images/upload.js +19 -19
  157. package/esm/index.d.ts +37 -37
  158. package/esm/index.js +37 -37
  159. package/esm/json.d.ts +8 -8
  160. package/esm/json.js +27 -27
  161. package/esm/math/diffDate.d.ts +5 -5
  162. package/esm/math/diffDate.js +9 -9
  163. package/esm/math/index.d.ts +30 -30
  164. package/esm/math/index.js +77 -77
  165. package/esm/math/positiveNumber.d.ts +2 -2
  166. package/esm/math/positiveNumber.js +12 -12
  167. package/esm/name/en.d.ts +5 -5
  168. package/esm/name/en.js +21 -21
  169. package/esm/name/index.d.ts +12 -12
  170. package/esm/name/index.js +5 -5
  171. package/esm/name/vi.d.ts +5 -5
  172. package/esm/name/vi.js +23 -23
  173. package/esm/object.d.ts +59 -59
  174. package/esm/object.js +69 -69
  175. package/esm/permission/index.d.ts +8 -8
  176. package/esm/permission/index.js +4 -4
  177. package/esm/permission/requestCamera.d.ts +5 -5
  178. package/esm/permission/requestCamera.js +38 -38
  179. package/esm/permission/requestDeviceOrientationControl.d.ts +2 -2
  180. package/esm/permission/requestDeviceOrientationControl.js +34 -34
  181. package/esm/response/index.d.ts +49 -49
  182. package/esm/response/index.js +45 -45
  183. package/esm/string/convertPathnameAndQuery.d.ts +4 -4
  184. package/esm/string/convertPathnameAndQuery.js +21 -21
  185. package/esm/string/formatNumber.d.ts +6 -6
  186. package/esm/string/formatNumber.js +10 -10
  187. package/esm/string/generatePassword.d.ts +9 -9
  188. package/esm/string/generatePassword.js +19 -19
  189. package/esm/string/generateUUID.d.ts +2 -2
  190. package/esm/string/generateUUID.js +32 -32
  191. package/esm/string/getTextBetweenCharByIndex.d.ts +1 -1
  192. package/esm/string/getTextBetweenCharByIndex.js +14 -14
  193. package/esm/string/index.d.ts +65 -65
  194. package/esm/string/index.js +150 -150
  195. package/esm/string/indexesOf.d.ts +1 -1
  196. package/esm/string/indexesOf.js +11 -11
  197. package/esm/string/makeDaySlug.d.ts +31 -31
  198. package/esm/string/makeDaySlug.js +15 -15
  199. package/esm/string/random.d.ts +18 -18
  200. package/esm/string/random.js +33 -33
  201. package/esm/string/trimNull.d.ts +2 -2
  202. package/esm/string/trimNull.js +13 -13
  203. package/esm/string/url.d.ts +22 -22
  204. package/esm/string/url.js +64 -64
  205. package/package.json +4 -4
@@ -1,18 +1,18 @@
1
- export declare const textLowCase = "abcdefghijklmnopqrstuvwxyz";
2
- export declare const numeric = "0123456789";
3
- export declare const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
4
- export declare const allCharacter = "\u0111\u0110a\u00E1\u00E0\u1EA3\u00E3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u00E2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\u00E9\u00E8\u1EBB\u1EBD\u1EB9\u00EA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\u00F3\u00F2\u1ECF\u00F5\u1ECD\u00F4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\u00ED\u00EC\u1EC9\u0129\u1ECBu\u00FA\u00F9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\u00FD\u1EF3\u1EF7\u1EF9\u1EF5A\u00C1\u00C0\u1EA2\u00C3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u00C2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\u00C9\u00C8\u1EBA\u1EBC\u1EB8\u00CA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\u00D3\u00D2\u1ECE\u00D5\u1ECC\u00D4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\u00CD\u00CC\u1EC8\u0128\u1ECAU\u00DA\u00D9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\u00DD\u1EF2 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}";
5
- /**
6
- * allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
7
- */
8
- export declare const randAllCharacterByLength: (length?: number) => string;
9
- export declare const randomStringByLength: (length: number, str?: string) => string;
10
- export declare const randomStringAndNumberByLength: (length: number, str?: string) => string;
11
- export declare const uniqueSortByTime: (length?: number, str?: string) => string;
12
- declare const random: {
13
- randAllCharacterByLength: (length?: number) => string;
14
- randomStringByLength: (length: number, str?: string) => string;
15
- randomStringAndNumberByLength: (length: number, str?: string) => string;
16
- uniqueSortByTime: (length?: number, str?: string) => string;
17
- };
18
- export default random;
1
+ export declare const textLowCase = "abcdefghijklmnopqrstuvwxyz";
2
+ export declare const numeric = "0123456789";
3
+ export declare const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
4
+ export declare const allCharacter = "\u0111\u0110a\u00E1\u00E0\u1EA3\u00E3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u00E2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\u00E9\u00E8\u1EBB\u1EBD\u1EB9\u00EA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\u00F3\u00F2\u1ECF\u00F5\u1ECD\u00F4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\u00ED\u00EC\u1EC9\u0129\u1ECBu\u00FA\u00F9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\u00FD\u1EF3\u1EF7\u1EF9\u1EF5A\u00C1\u00C0\u1EA2\u00C3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u00C2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\u00C9\u00C8\u1EBA\u1EBC\u1EB8\u00CA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\u00D3\u00D2\u1ECE\u00D5\u1ECC\u00D4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\u00CD\u00CC\u1EC8\u0128\u1ECAU\u00DA\u00D9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\u00DD\u1EF2 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}";
5
+ /**
6
+ * allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
7
+ */
8
+ export declare const randAllCharacterByLength: (length?: number) => string;
9
+ export declare const randomStringByLength: (length: number, str?: string) => string;
10
+ export declare const randomStringAndNumberByLength: (length: number, str?: string) => string;
11
+ export declare const uniqueSortByTime: (length?: number, str?: string) => string;
12
+ declare const random: {
13
+ randAllCharacterByLength: (length?: number) => string;
14
+ randomStringByLength: (length: number, str?: string) => string;
15
+ randomStringAndNumberByLength: (length: number, str?: string) => string;
16
+ uniqueSortByTime: (length?: number, str?: string) => string;
17
+ };
18
+ export default random;
@@ -1,41 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uniqueSortByTime = exports.randomStringAndNumberByLength = exports.randomStringByLength = exports.randAllCharacterByLength = exports.allCharacter = exports.punctuation = exports.numeric = exports.textLowCase = void 0;
4
- exports.textLowCase = "abcdefghijklmnopqrstuvwxyz";
5
- exports.numeric = "0123456789";
6
- exports.punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
7
- exports.allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
8
- /**
9
- * allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
10
- */
11
- const randAllCharacterByLength = (length = 0) => {
12
- return (0, exports.randomStringByLength)(length, exports.allCharacter);
13
- };
14
- exports.randAllCharacterByLength = randAllCharacterByLength;
15
- const randomStringByLength = (length, str = exports.textLowCase) => {
16
- let result = "";
17
- for (let i = 0; i < length; i++) {
18
- result += str.charAt(Math.floor(Math.random() * str.length));
19
- }
20
- return result;
21
- };
22
- exports.randomStringByLength = randomStringByLength;
23
- const randomStringAndNumberByLength = (length, str = `${exports.textLowCase}${exports.numeric}`) => {
24
- let result = "";
25
- for (let i = 0; i < length; i++) {
26
- result += str.charAt(Math.floor(Math.random() * str.length));
27
- }
28
- return result;
29
- };
30
- exports.randomStringAndNumberByLength = randomStringAndNumberByLength;
31
- const uniqueSortByTime = (length = 6, str = `${exports.textLowCase}${exports.numeric}`) => {
32
- let result = `${+new Date()}-`;
33
- for (let i = 0; i < length; i++) {
34
- result += str.charAt(Math.floor(Math.random() * str.length));
35
- }
36
- return result;
37
- };
38
- exports.uniqueSortByTime = uniqueSortByTime;
39
- const random = { randAllCharacterByLength: exports.randAllCharacterByLength, randomStringByLength: exports.randomStringByLength, randomStringAndNumberByLength: exports.randomStringAndNumberByLength, uniqueSortByTime: exports.uniqueSortByTime };
40
- exports.default = random;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uniqueSortByTime = exports.randomStringAndNumberByLength = exports.randomStringByLength = exports.randAllCharacterByLength = exports.allCharacter = exports.punctuation = exports.numeric = exports.textLowCase = void 0;
4
+ exports.textLowCase = "abcdefghijklmnopqrstuvwxyz";
5
+ exports.numeric = "0123456789";
6
+ exports.punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
7
+ exports.allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
8
+ /**
9
+ * allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
10
+ */
11
+ const randAllCharacterByLength = (length = 0) => {
12
+ return (0, exports.randomStringByLength)(length, exports.allCharacter);
13
+ };
14
+ exports.randAllCharacterByLength = randAllCharacterByLength;
15
+ const randomStringByLength = (length, str = exports.textLowCase) => {
16
+ let result = "";
17
+ for (let i = 0; i < length; i++) {
18
+ result += str.charAt(Math.floor(Math.random() * str.length));
19
+ }
20
+ return result;
21
+ };
22
+ exports.randomStringByLength = randomStringByLength;
23
+ const randomStringAndNumberByLength = (length, str = `${exports.textLowCase}${exports.numeric}`) => {
24
+ let result = "";
25
+ for (let i = 0; i < length; i++) {
26
+ result += str.charAt(Math.floor(Math.random() * str.length));
27
+ }
28
+ return result;
29
+ };
30
+ exports.randomStringAndNumberByLength = randomStringAndNumberByLength;
31
+ const uniqueSortByTime = (length = 6, str = `${exports.textLowCase}${exports.numeric}`) => {
32
+ let result = `${+new Date()}-`;
33
+ for (let i = 0; i < length; i++) {
34
+ result += str.charAt(Math.floor(Math.random() * str.length));
35
+ }
36
+ return result;
37
+ };
38
+ exports.uniqueSortByTime = uniqueSortByTime;
39
+ const random = { randAllCharacterByLength: exports.randAllCharacterByLength, randomStringByLength: exports.randomStringByLength, randomStringAndNumberByLength: exports.randomStringAndNumberByLength, uniqueSortByTime: exports.uniqueSortByTime };
40
+ exports.default = random;
41
41
  //# sourceMappingURL=random.js.map
@@ -1,2 +1,2 @@
1
- export declare function trimNull(str: string): string;
2
- export default trimNull;
1
+ export declare function trimNull(str: string): string;
2
+ export default trimNull;
@@ -1,21 +1,21 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.trimNull = void 0;
7
- const trim_1 = __importDefault(require("lodash/trim"));
8
- function trimNull(str) {
9
- if (!str)
10
- return "";
11
- str = str.toString();
12
- str = str.replace(/\0/g, "");
13
- while (str.indexOf(" ") >= 0) {
14
- str = str.replaceAll(" ", " ");
15
- }
16
- str = (0, trim_1.default)(str);
17
- return str;
18
- }
19
- exports.trimNull = trimNull;
20
- exports.default = trimNull;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.trimNull = void 0;
7
+ const trim_1 = __importDefault(require("lodash/trim"));
8
+ function trimNull(str) {
9
+ if (!str)
10
+ return "";
11
+ str = str.toString();
12
+ str = str.replace(/\0/g, "");
13
+ while (str.indexOf(" ") >= 0) {
14
+ str = str.replaceAll(" ", " ");
15
+ }
16
+ str = (0, trim_1.default)(str);
17
+ return str;
18
+ }
19
+ exports.trimNull = trimNull;
20
+ exports.default = trimNull;
21
21
  //# sourceMappingURL=trimNull.js.map
@@ -1,22 +1,22 @@
1
- export declare const addQueryParam: (_url: string, key: string, value: any) => string;
2
- export declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
3
- export declare const isLink: (str: string) => boolean;
4
- export declare const getFileNameWithoutExtension: (url: string) => string;
5
- export declare const getFileNameWithExtension: (url: string) => string;
6
- export declare const getFileExtension: (url: string) => string | null | undefined;
7
- /**
8
- *
9
- * @param {string} url
10
- * @returns
11
- */
12
- export declare const isImage: (url: string) => boolean;
13
- declare const xurl: {
14
- addQueryParam: (_url: string, key: string, value: any) => string;
15
- getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
16
- isLink: (str: string) => boolean;
17
- getFileNameWithoutExtension: (url: string) => string;
18
- getFileNameWithExtension: (url: string) => string;
19
- getFileExtension: (url: string) => string | null | undefined;
20
- isImage: (url: string) => boolean;
21
- };
22
- export default xurl;
1
+ export declare const addQueryParam: (_url: string, key: string, value: any) => string;
2
+ export declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
3
+ export declare const isLink: (str: string) => boolean;
4
+ export declare const getFileNameWithoutExtension: (url: string) => string;
5
+ export declare const getFileNameWithExtension: (url: string) => string;
6
+ export declare const getFileExtension: (url: string) => string | null | undefined;
7
+ /**
8
+ *
9
+ * @param {string} url
10
+ * @returns
11
+ */
12
+ export declare const isImage: (url: string) => boolean;
13
+ declare const xurl: {
14
+ addQueryParam: (_url: string, key: string, value: any) => string;
15
+ getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
16
+ isLink: (str: string) => boolean;
17
+ getFileNameWithoutExtension: (url: string) => string;
18
+ getFileNameWithExtension: (url: string) => string;
19
+ getFileExtension: (url: string) => string | null | undefined;
20
+ isImage: (url: string) => boolean;
21
+ };
22
+ export default xurl;
@@ -1,75 +1,75 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isImage = exports.getFileExtension = exports.getFileNameWithExtension = exports.getFileNameWithoutExtension = exports.isLink = exports.getUrlParams = exports.addQueryParam = void 0;
4
- var urlRegex = /(https?:\/\/[^\s]+)/g;
5
- const addQueryParam = (_url, key, value) => {
6
- _url += (_url.split("?")[1] ? "&" : "?") + `${key}=${value}`;
7
- return _url;
8
- };
9
- exports.addQueryParam = addQueryParam;
10
- const getUrlParams = (parameter, staticURL, decode = true) => {
11
- if (typeof window == "undefined")
12
- return "";
13
- staticURL = staticURL == undefined ? window.location.host : staticURL;
14
- var currLocation = staticURL.length > 0 ? staticURL : window.location.search;
15
- if (currLocation.split("?").length < 2)
16
- return "";
17
- var parArr = currLocation.split("?")[1].split("&"), returnBool = true;
18
- for (var i = 0; i < parArr.length; i++) {
19
- var parr = parArr[i].split("=");
20
- if (parr[0] == parameter) {
21
- return decode ? decodeURIComponent(parr[1]) : parr[1];
22
- returnBool = true;
23
- }
24
- else {
25
- returnBool = false;
26
- }
27
- }
28
- if (!returnBool)
29
- return false;
30
- };
31
- exports.getUrlParams = getUrlParams;
32
- const isLink = (str) => {
33
- return urlRegex.test(str);
34
- };
35
- exports.isLink = isLink;
36
- const getFileNameWithoutExtension = (url) => {
37
- var _a, _b;
38
- return ((_b = (_a = (0, exports.getFileNameWithExtension)(url)) === null || _a === void 0 ? void 0 : _a.split(".")) === null || _b === void 0 ? void 0 : _b[0]) || "";
39
- };
40
- exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
41
- const getFileNameWithExtension = (url) => {
42
- url = url.replaceAll("\\", "/");
43
- const _url = decodeURIComponent(url);
44
- const m = `${_url.toString().match(/(?:.*\/)?([^\/]+)/)}`;
45
- if (m && m.split(",").length > 1) {
46
- return m.split(",")[1].replace(/(\?.*)|(\&.*)/, "");
47
- }
48
- return "";
49
- };
50
- exports.getFileNameWithExtension = getFileNameWithExtension;
51
- const getFileExtension = (url) => {
52
- const arr = (0, exports.getFileNameWithExtension)(url).split(".");
53
- if (arr.length > 1)
54
- return (0, exports.getFileNameWithExtension)(url).split(".").pop();
55
- return null;
56
- };
57
- exports.getFileExtension = getFileExtension;
58
- /**
59
- *
60
- * @param {string} url
61
- * @returns
62
- */
63
- const isImage = (url) => {
64
- if (!url)
65
- return false;
66
- const arr = [".png", ".jpg", ".jpeg", ".jpe", ".jif", ".jfif", ".gif", ".svg"];
67
- const index = arr.findIndex((item) => {
68
- return url.indexOf(item) >= 0;
69
- });
70
- return index >= 0;
71
- };
72
- exports.isImage = isImage;
73
- const xurl = { addQueryParam: exports.addQueryParam, getUrlParams: exports.getUrlParams, isLink: exports.isLink, getFileNameWithoutExtension: exports.getFileNameWithoutExtension, getFileNameWithExtension: exports.getFileNameWithExtension, getFileExtension: exports.getFileExtension, isImage: exports.isImage };
74
- exports.default = xurl;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isImage = exports.getFileExtension = exports.getFileNameWithExtension = exports.getFileNameWithoutExtension = exports.isLink = exports.getUrlParams = exports.addQueryParam = void 0;
4
+ var urlRegex = /(https?:\/\/[^\s]+)/g;
5
+ const addQueryParam = (_url, key, value) => {
6
+ _url += (_url.split("?")[1] ? "&" : "?") + `${key}=${value}`;
7
+ return _url;
8
+ };
9
+ exports.addQueryParam = addQueryParam;
10
+ const getUrlParams = (parameter, staticURL, decode = true) => {
11
+ if (typeof window == "undefined")
12
+ return "";
13
+ staticURL = staticURL == undefined ? window.location.host : staticURL;
14
+ var currLocation = staticURL.length > 0 ? staticURL : window.location.search;
15
+ if (currLocation.split("?").length < 2)
16
+ return "";
17
+ var parArr = currLocation.split("?")[1].split("&"), returnBool = true;
18
+ for (var i = 0; i < parArr.length; i++) {
19
+ var parr = parArr[i].split("=");
20
+ if (parr[0] == parameter) {
21
+ return decode ? decodeURIComponent(parr[1]) : parr[1];
22
+ returnBool = true;
23
+ }
24
+ else {
25
+ returnBool = false;
26
+ }
27
+ }
28
+ if (!returnBool)
29
+ return false;
30
+ };
31
+ exports.getUrlParams = getUrlParams;
32
+ const isLink = (str) => {
33
+ return urlRegex.test(str);
34
+ };
35
+ exports.isLink = isLink;
36
+ const getFileNameWithoutExtension = (url) => {
37
+ var _a, _b;
38
+ return ((_b = (_a = (0, exports.getFileNameWithExtension)(url)) === null || _a === void 0 ? void 0 : _a.split(".")) === null || _b === void 0 ? void 0 : _b[0]) || "";
39
+ };
40
+ exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
41
+ const getFileNameWithExtension = (url) => {
42
+ url = url.replaceAll("\\", "/");
43
+ const _url = decodeURIComponent(url);
44
+ const m = `${_url.toString().match(/(?:.*\/)?([^\/]+)/)}`;
45
+ if (m && m.split(",").length > 1) {
46
+ return m.split(",")[1].replace(/(\?.*)|(\&.*)/, "");
47
+ }
48
+ return "";
49
+ };
50
+ exports.getFileNameWithExtension = getFileNameWithExtension;
51
+ const getFileExtension = (url) => {
52
+ const arr = (0, exports.getFileNameWithExtension)(url).split(".");
53
+ if (arr.length > 1)
54
+ return (0, exports.getFileNameWithExtension)(url).split(".").pop();
55
+ return null;
56
+ };
57
+ exports.getFileExtension = getFileExtension;
58
+ /**
59
+ *
60
+ * @param {string} url
61
+ * @returns
62
+ */
63
+ const isImage = (url) => {
64
+ if (!url)
65
+ return false;
66
+ const arr = [".png", ".jpg", ".jpeg", ".jpe", ".jif", ".jfif", ".gif", ".svg"];
67
+ const index = arr.findIndex((item) => {
68
+ return url.indexOf(item) >= 0;
69
+ });
70
+ return index >= 0;
71
+ };
72
+ exports.isImage = isImage;
73
+ const xurl = { addQueryParam: exports.addQueryParam, getUrlParams: exports.getUrlParams, isLink: exports.isLink, getFileNameWithoutExtension: exports.getFileNameWithoutExtension, getFileNameWithExtension: exports.getFileNameWithExtension, getFileExtension: exports.getFileExtension, isImage: exports.isImage };
74
+ exports.default = xurl;
75
75
  //# sourceMappingURL=url.js.map
package/esm/Checker.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * Check if the object or string is in JSON format
3
- */
4
- export declare const isJSON: (content: object | string) => boolean;
5
- declare const Checker: {
6
- isJSON: (content: object | string) => boolean;
7
- };
8
- export default Checker;
1
+ /**
2
+ * Check if the object or string is in JSON format
3
+ */
4
+ export declare const isJSON: (content: object | string) => boolean;
5
+ declare const Checker: {
6
+ isJSON: (content: object | string) => boolean;
7
+ };
8
+ export default Checker;
package/esm/Checker.js CHANGED
@@ -1,28 +1,28 @@
1
- /**
2
- * Check if the object or string is in JSON format
3
- */
4
- export const isJSON = (content) => {
5
- if (typeof content == "object") {
6
- try {
7
- content = JSON.stringify(content);
8
- }
9
- catch (err) {
10
- return false;
11
- }
12
- }
13
- if (typeof content == "string") {
14
- try {
15
- content = JSON.parse(content);
16
- }
17
- catch (err) {
18
- return false;
19
- }
20
- }
21
- if (typeof content != "object") {
22
- return false;
23
- }
24
- return true;
25
- };
26
- const Checker = { isJSON };
27
- export default Checker;
1
+ /**
2
+ * Check if the object or string is in JSON format
3
+ */
4
+ export const isJSON = (content) => {
5
+ if (typeof content == "object") {
6
+ try {
7
+ content = JSON.stringify(content);
8
+ }
9
+ catch (err) {
10
+ return false;
11
+ }
12
+ }
13
+ if (typeof content == "string") {
14
+ try {
15
+ content = JSON.parse(content);
16
+ }
17
+ catch (err) {
18
+ return false;
19
+ }
20
+ }
21
+ if (typeof content != "object") {
22
+ return false;
23
+ }
24
+ return true;
25
+ };
26
+ const Checker = { isJSON };
27
+ export default Checker;
28
28
  //# sourceMappingURL=Checker.js.map
@@ -1,13 +1,13 @@
1
- declare class EventDispatcher {
2
- constructor();
3
- _listeners: any;
4
- addEventListener(type: string, listener: any): void;
5
- hasEventListener(type: string, listener: any): boolean;
6
- removeEventListener(type: string, listener: any): void;
7
- dispatchEvent(event: {
8
- type: string;
9
- target: any;
10
- }): void;
11
- }
12
- export { EventDispatcher };
13
- export default EventDispatcher;
1
+ declare class EventDispatcher {
2
+ constructor();
3
+ _listeners: any;
4
+ addEventListener(type: string, listener: any): void;
5
+ hasEventListener(type: string, listener: any): boolean;
6
+ removeEventListener(type: string, listener: any): void;
7
+ dispatchEvent(event: {
8
+ type: string;
9
+ target: any;
10
+ }): void;
11
+ }
12
+ export { EventDispatcher };
13
+ export default EventDispatcher;
@@ -1,49 +1,49 @@
1
- class EventDispatcher {
2
- constructor() { }
3
- addEventListener(type, listener) {
4
- if (this._listeners === undefined)
5
- this._listeners = {};
6
- const listeners = this._listeners;
7
- if (listeners[type] === undefined) {
8
- listeners[type] = [];
9
- }
10
- if (listeners[type].indexOf(listener) === -1) {
11
- listeners[type].push(listener);
12
- }
13
- }
14
- hasEventListener(type, listener) {
15
- if (this._listeners === undefined)
16
- return false;
17
- const listeners = this._listeners;
18
- return listeners[type] !== undefined && listeners[type].indexOf(listener) !== -1;
19
- }
20
- removeEventListener(type, listener) {
21
- if (this._listeners === undefined)
22
- return;
23
- const listeners = this._listeners;
24
- const listenerArray = listeners[type];
25
- if (listenerArray !== undefined) {
26
- const index = listenerArray.indexOf(listener);
27
- if (index !== -1) {
28
- listenerArray.splice(index, 1);
29
- }
30
- }
31
- }
32
- dispatchEvent(event) {
33
- if (this._listeners === undefined)
34
- return;
35
- const listeners = this._listeners;
36
- const listenerArray = listeners[event.type];
37
- if (listenerArray !== undefined) {
38
- event.target = this;
39
- // Make a copy, in case listeners are removed while iterating.
40
- const array = listenerArray.slice(0);
41
- for (let i = 0, l = array.length; i < l; i++) {
42
- array[i].call(this, event);
43
- }
44
- }
45
- }
46
- }
47
- export { EventDispatcher };
48
- export default EventDispatcher;
1
+ class EventDispatcher {
2
+ constructor() { }
3
+ addEventListener(type, listener) {
4
+ if (this._listeners === undefined)
5
+ this._listeners = {};
6
+ const listeners = this._listeners;
7
+ if (listeners[type] === undefined) {
8
+ listeners[type] = [];
9
+ }
10
+ if (listeners[type].indexOf(listener) === -1) {
11
+ listeners[type].push(listener);
12
+ }
13
+ }
14
+ hasEventListener(type, listener) {
15
+ if (this._listeners === undefined)
16
+ return false;
17
+ const listeners = this._listeners;
18
+ return listeners[type] !== undefined && listeners[type].indexOf(listener) !== -1;
19
+ }
20
+ removeEventListener(type, listener) {
21
+ if (this._listeners === undefined)
22
+ return;
23
+ const listeners = this._listeners;
24
+ const listenerArray = listeners[type];
25
+ if (listenerArray !== undefined) {
26
+ const index = listenerArray.indexOf(listener);
27
+ if (index !== -1) {
28
+ listenerArray.splice(index, 1);
29
+ }
30
+ }
31
+ }
32
+ dispatchEvent(event) {
33
+ if (this._listeners === undefined)
34
+ return;
35
+ const listeners = this._listeners;
36
+ const listenerArray = listeners[event.type];
37
+ if (listenerArray !== undefined) {
38
+ event.target = this;
39
+ // Make a copy, in case listeners are removed while iterating.
40
+ const array = listenerArray.slice(0);
41
+ for (let i = 0, l = array.length; i < l; i++) {
42
+ array[i].call(this, event);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ export { EventDispatcher };
48
+ export default EventDispatcher;
49
49
  //# sourceMappingURL=EventDispatcher.js.map
@@ -1,12 +1,12 @@
1
- type UploadParams = {
2
- blob: Blob;
3
- url: string;
4
- params: any;
5
- onComplete: any;
6
- onError: any;
7
- };
8
- declare const FileUpload: {
9
- uploadBlob(props: UploadParams): void;
10
- };
11
- export { FileUpload };
12
- export default FileUpload;
1
+ type UploadParams = {
2
+ blob: Blob;
3
+ url: string;
4
+ params: any;
5
+ onComplete: any;
6
+ onError: any;
7
+ };
8
+ declare const FileUpload: {
9
+ uploadBlob(props: UploadParams): void;
10
+ };
11
+ export { FileUpload };
12
+ export default FileUpload;