diginext-utils 2.1.18 → 2.1.19

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 (295) hide show
  1. package/package.json +1 -1
  2. package/dist/Checker.d.ts +0 -8
  3. package/dist/Checker.js +0 -32
  4. package/dist/Checker.js.map +0 -1
  5. package/dist/EventDispatcher.d.ts +0 -13
  6. package/dist/EventDispatcher.js +0 -52
  7. package/dist/EventDispatcher.js.map +0 -1
  8. package/dist/FileUpload.d.ts +0 -12
  9. package/dist/FileUpload.js +0 -65
  10. package/dist/FileUpload.js.map +0 -1
  11. package/dist/Slug.d.ts +0 -9
  12. package/dist/Slug.js +0 -334
  13. package/dist/Slug.js.map +0 -1
  14. package/dist/Timer.d.ts +0 -4
  15. package/dist/Timer.js +0 -9
  16. package/dist/Timer.js.map +0 -1
  17. package/dist/Validation.d.ts +0 -5
  18. package/dist/Validation.js +0 -39
  19. package/dist/Validation.js.map +0 -1
  20. package/dist/array.d.ts +0 -113
  21. package/dist/array.js +0 -298
  22. package/dist/array.js.map +0 -1
  23. package/dist/color.d.ts +0 -25
  24. package/dist/color.js +0 -96
  25. package/dist/color.js.map +0 -1
  26. package/dist/console/enableConsole.d.ts +0 -2
  27. package/dist/console/enableConsole.js +0 -14
  28. package/dist/console/enableConsole.js.map +0 -1
  29. package/dist/console/index.d.ts +0 -11
  30. package/dist/console/index.js +0 -18
  31. package/dist/console/index.js.map +0 -1
  32. package/dist/console/log.d.ts +0 -15
  33. package/dist/console/log.js +0 -45
  34. package/dist/console/log.js.map +0 -1
  35. package/dist/device/browser.d.ts +0 -5
  36. package/dist/device/browser.js +0 -38
  37. package/dist/device/browser.js.map +0 -1
  38. package/dist/device/camera.d.ts +0 -7
  39. package/dist/device/camera.js +0 -172
  40. package/dist/device/camera.js.map +0 -1
  41. package/dist/device/index.d.ts +0 -5
  42. package/dist/device/index.js +0 -225
  43. package/dist/device/index.js.map +0 -1
  44. package/dist/device/os.d.ts +0 -11
  45. package/dist/device/os.js +0 -38
  46. package/dist/device/os.js.map +0 -1
  47. package/dist/file/createDir.d.ts +0 -5
  48. package/dist/file/createDir.js +0 -16
  49. package/dist/file/createDir.js.map +0 -1
  50. package/dist/file/fileMove.d.ts +0 -4
  51. package/dist/file/fileMove.js +0 -33
  52. package/dist/file/fileMove.js.map +0 -1
  53. package/dist/file/findFilesByExt.d.ts +0 -13
  54. package/dist/file/findFilesByExt.js +0 -50
  55. package/dist/file/findFilesByExt.js.map +0 -1
  56. package/dist/file/index.d.ts +0 -9
  57. package/dist/file/index.js +0 -11
  58. package/dist/file/index.js.map +0 -1
  59. package/dist/gameboi/index.d.ts +0 -10
  60. package/dist/gameboi/index.js +0 -68
  61. package/dist/gameboi/index.js.map +0 -1
  62. package/dist/images/downloadByUrl.d.ts +0 -1
  63. package/dist/images/downloadByUrl.js +0 -56
  64. package/dist/images/downloadByUrl.js.map +0 -1
  65. package/dist/images/index.d.ts +0 -2
  66. package/dist/images/index.js +0 -9
  67. package/dist/images/index.js.map +0 -1
  68. package/dist/images/loadImage.d.ts +0 -1
  69. package/dist/images/loadImage.js +0 -18
  70. package/dist/images/loadImage.js.map +0 -1
  71. package/dist/images/resize.d.ts +0 -2
  72. package/dist/images/resize.js +0 -38
  73. package/dist/images/resize.js.map +0 -1
  74. package/dist/images/upload.d.ts +0 -10
  75. package/dist/images/upload.js +0 -27
  76. package/dist/images/upload.js.map +0 -1
  77. package/dist/index.d.ts +0 -37
  78. package/dist/index.js +0 -63
  79. package/dist/index.js.map +0 -1
  80. package/dist/json.d.ts +0 -8
  81. package/dist/json.js +0 -32
  82. package/dist/json.js.map +0 -1
  83. package/dist/math/diffDate.d.ts +0 -5
  84. package/dist/math/diffDate.js +0 -14
  85. package/dist/math/diffDate.js.map +0 -1
  86. package/dist/math/index.d.ts +0 -30
  87. package/dist/math/index.js +0 -93
  88. package/dist/math/index.js.map +0 -1
  89. package/dist/math/positiveNumber.d.ts +0 -2
  90. package/dist/math/positiveNumber.js +0 -17
  91. package/dist/math/positiveNumber.js.map +0 -1
  92. package/dist/name/en.d.ts +0 -5
  93. package/dist/name/en.js +0 -26
  94. package/dist/name/en.js.map +0 -1
  95. package/dist/name/index.d.ts +0 -12
  96. package/dist/name/index.js +0 -13
  97. package/dist/name/index.js.map +0 -1
  98. package/dist/name/vi.d.ts +0 -5
  99. package/dist/name/vi.js +0 -28
  100. package/dist/name/vi.js.map +0 -1
  101. package/dist/object.d.ts +0 -59
  102. package/dist/object.js +0 -80
  103. package/dist/object.js.map +0 -1
  104. package/dist/permission/index.d.ts +0 -8
  105. package/dist/permission/index.js +0 -7
  106. package/dist/permission/index.js.map +0 -1
  107. package/dist/permission/requestCamera.d.ts +0 -5
  108. package/dist/permission/requestCamera.js +0 -43
  109. package/dist/permission/requestCamera.js.map +0 -1
  110. package/dist/permission/requestDeviceOrientationControl.d.ts +0 -2
  111. package/dist/permission/requestDeviceOrientationControl.js +0 -39
  112. package/dist/permission/requestDeviceOrientationControl.js.map +0 -1
  113. package/dist/response/index.d.ts +0 -49
  114. package/dist/response/index.js +0 -52
  115. package/dist/response/index.js.map +0 -1
  116. package/dist/string/convertPathnameAndQuery.d.ts +0 -4
  117. package/dist/string/convertPathnameAndQuery.js +0 -25
  118. package/dist/string/convertPathnameAndQuery.js.map +0 -1
  119. package/dist/string/formatNumber.d.ts +0 -6
  120. package/dist/string/formatNumber.js +0 -15
  121. package/dist/string/formatNumber.js.map +0 -1
  122. package/dist/string/generatePassword.d.ts +0 -9
  123. package/dist/string/generatePassword.js +0 -24
  124. package/dist/string/generatePassword.js.map +0 -1
  125. package/dist/string/generateUUID.d.ts +0 -2
  126. package/dist/string/generateUUID.js +0 -37
  127. package/dist/string/generateUUID.js.map +0 -1
  128. package/dist/string/getTextBetweenCharByIndex.d.ts +0 -1
  129. package/dist/string/getTextBetweenCharByIndex.js +0 -21
  130. package/dist/string/getTextBetweenCharByIndex.js.map +0 -1
  131. package/dist/string/index.d.ts +0 -65
  132. package/dist/string/index.js +0 -162
  133. package/dist/string/index.js.map +0 -1
  134. package/dist/string/indexesOf.d.ts +0 -1
  135. package/dist/string/indexesOf.js +0 -15
  136. package/dist/string/indexesOf.js.map +0 -1
  137. package/dist/string/makeDaySlug.d.ts +0 -31
  138. package/dist/string/makeDaySlug.js +0 -23
  139. package/dist/string/makeDaySlug.js.map +0 -1
  140. package/dist/string/random.d.ts +0 -18
  141. package/dist/string/random.js +0 -41
  142. package/dist/string/random.js.map +0 -1
  143. package/dist/string/trimNull.d.ts +0 -2
  144. package/dist/string/trimNull.js +0 -21
  145. package/dist/string/trimNull.js.map +0 -1
  146. package/dist/string/url.d.ts +0 -22
  147. package/dist/string/url.js +0 -75
  148. package/dist/string/url.js.map +0 -1
  149. package/esm/Checker.d.ts +0 -8
  150. package/esm/Checker.js +0 -28
  151. package/esm/Checker.js.map +0 -1
  152. package/esm/EventDispatcher.d.ts +0 -13
  153. package/esm/EventDispatcher.js +0 -49
  154. package/esm/EventDispatcher.js.map +0 -1
  155. package/esm/FileUpload.d.ts +0 -12
  156. package/esm/FileUpload.js +0 -62
  157. package/esm/FileUpload.js.map +0 -1
  158. package/esm/Slug.d.ts +0 -9
  159. package/esm/Slug.js +0 -330
  160. package/esm/Slug.js.map +0 -1
  161. package/esm/Timer.d.ts +0 -4
  162. package/esm/Timer.js +0 -7
  163. package/esm/Timer.js.map +0 -1
  164. package/esm/Validation.d.ts +0 -5
  165. package/esm/Validation.js +0 -37
  166. package/esm/Validation.js.map +0 -1
  167. package/esm/array.d.ts +0 -113
  168. package/esm/array.js +0 -276
  169. package/esm/array.js.map +0 -1
  170. package/esm/color.d.ts +0 -25
  171. package/esm/color.js +0 -86
  172. package/esm/color.js.map +0 -1
  173. package/esm/console/enableConsole.d.ts +0 -2
  174. package/esm/console/enableConsole.js +0 -7
  175. package/esm/console/enableConsole.js.map +0 -1
  176. package/esm/console/index.d.ts +0 -11
  177. package/esm/console/index.js +0 -13
  178. package/esm/console/index.js.map +0 -1
  179. package/esm/console/log.d.ts +0 -15
  180. package/esm/console/log.js +0 -33
  181. package/esm/console/log.js.map +0 -1
  182. package/esm/device/browser.d.ts +0 -5
  183. package/esm/device/browser.js +0 -30
  184. package/esm/device/browser.js.map +0 -1
  185. package/esm/device/camera.d.ts +0 -7
  186. package/esm/device/camera.js +0 -168
  187. package/esm/device/camera.js.map +0 -1
  188. package/esm/device/index.d.ts +0 -5
  189. package/esm/device/index.js +0 -217
  190. package/esm/device/index.js.map +0 -1
  191. package/esm/device/os.d.ts +0 -11
  192. package/esm/device/os.js +0 -28
  193. package/esm/device/os.js.map +0 -1
  194. package/esm/file/createDir.d.ts +0 -5
  195. package/esm/file/createDir.js +0 -13
  196. package/esm/file/createDir.js.map +0 -1
  197. package/esm/file/fileMove.d.ts +0 -4
  198. package/esm/file/fileMove.js +0 -29
  199. package/esm/file/fileMove.js.map +0 -1
  200. package/esm/file/findFilesByExt.d.ts +0 -13
  201. package/esm/file/findFilesByExt.js +0 -46
  202. package/esm/file/findFilesByExt.js.map +0 -1
  203. package/esm/file/index.d.ts +0 -9
  204. package/esm/file/index.js +0 -6
  205. package/esm/file/index.js.map +0 -1
  206. package/esm/gameboi/index.d.ts +0 -10
  207. package/esm/gameboi/index.js +0 -62
  208. package/esm/gameboi/index.js.map +0 -1
  209. package/esm/images/downloadByUrl.d.ts +0 -1
  210. package/esm/images/downloadByUrl.js +0 -53
  211. package/esm/images/downloadByUrl.js.map +0 -1
  212. package/esm/images/index.d.ts +0 -2
  213. package/esm/images/index.js +0 -4
  214. package/esm/images/index.js.map +0 -1
  215. package/esm/images/loadImage.d.ts +0 -1
  216. package/esm/images/loadImage.js +0 -15
  217. package/esm/images/loadImage.js.map +0 -1
  218. package/esm/images/resize.d.ts +0 -2
  219. package/esm/images/resize.js +0 -31
  220. package/esm/images/resize.js.map +0 -1
  221. package/esm/images/upload.d.ts +0 -10
  222. package/esm/images/upload.js +0 -20
  223. package/esm/images/upload.js.map +0 -1
  224. package/esm/index.d.ts +0 -37
  225. package/esm/index.js +0 -38
  226. package/esm/index.js.map +0 -1
  227. package/esm/json.d.ts +0 -8
  228. package/esm/json.js +0 -28
  229. package/esm/json.js.map +0 -1
  230. package/esm/math/diffDate.d.ts +0 -5
  231. package/esm/math/diffDate.js +0 -10
  232. package/esm/math/diffDate.js.map +0 -1
  233. package/esm/math/index.d.ts +0 -30
  234. package/esm/math/index.js +0 -78
  235. package/esm/math/index.js.map +0 -1
  236. package/esm/math/positiveNumber.d.ts +0 -2
  237. package/esm/math/positiveNumber.js +0 -13
  238. package/esm/math/positiveNumber.js.map +0 -1
  239. package/esm/name/en.d.ts +0 -5
  240. package/esm/name/en.js +0 -22
  241. package/esm/name/en.js.map +0 -1
  242. package/esm/name/index.d.ts +0 -12
  243. package/esm/name/index.js +0 -6
  244. package/esm/name/index.js.map +0 -1
  245. package/esm/name/vi.d.ts +0 -5
  246. package/esm/name/vi.js +0 -24
  247. package/esm/name/vi.js.map +0 -1
  248. package/esm/object.d.ts +0 -59
  249. package/esm/object.js +0 -70
  250. package/esm/object.js.map +0 -1
  251. package/esm/permission/index.d.ts +0 -8
  252. package/esm/permission/index.js +0 -5
  253. package/esm/permission/index.js.map +0 -1
  254. package/esm/permission/requestCamera.d.ts +0 -5
  255. package/esm/permission/requestCamera.js +0 -39
  256. package/esm/permission/requestCamera.js.map +0 -1
  257. package/esm/permission/requestDeviceOrientationControl.d.ts +0 -2
  258. package/esm/permission/requestDeviceOrientationControl.js +0 -35
  259. package/esm/permission/requestDeviceOrientationControl.js.map +0 -1
  260. package/esm/response/index.d.ts +0 -49
  261. package/esm/response/index.js +0 -46
  262. package/esm/response/index.js.map +0 -1
  263. package/esm/string/convertPathnameAndQuery.d.ts +0 -4
  264. package/esm/string/convertPathnameAndQuery.js +0 -22
  265. package/esm/string/convertPathnameAndQuery.js.map +0 -1
  266. package/esm/string/formatNumber.d.ts +0 -6
  267. package/esm/string/formatNumber.js +0 -11
  268. package/esm/string/formatNumber.js.map +0 -1
  269. package/esm/string/generatePassword.d.ts +0 -9
  270. package/esm/string/generatePassword.js +0 -20
  271. package/esm/string/generatePassword.js.map +0 -1
  272. package/esm/string/generateUUID.d.ts +0 -2
  273. package/esm/string/generateUUID.js +0 -33
  274. package/esm/string/generateUUID.js.map +0 -1
  275. package/esm/string/getTextBetweenCharByIndex.d.ts +0 -1
  276. package/esm/string/getTextBetweenCharByIndex.js +0 -15
  277. package/esm/string/getTextBetweenCharByIndex.js.map +0 -1
  278. package/esm/string/index.d.ts +0 -65
  279. package/esm/string/index.js +0 -151
  280. package/esm/string/index.js.map +0 -1
  281. package/esm/string/indexesOf.d.ts +0 -1
  282. package/esm/string/indexesOf.js +0 -12
  283. package/esm/string/indexesOf.js.map +0 -1
  284. package/esm/string/makeDaySlug.d.ts +0 -31
  285. package/esm/string/makeDaySlug.js +0 -16
  286. package/esm/string/makeDaySlug.js.map +0 -1
  287. package/esm/string/random.d.ts +0 -18
  288. package/esm/string/random.js +0 -34
  289. package/esm/string/random.js.map +0 -1
  290. package/esm/string/trimNull.d.ts +0 -2
  291. package/esm/string/trimNull.js +0 -14
  292. package/esm/string/trimNull.js.map +0 -1
  293. package/esm/string/url.d.ts +0 -22
  294. package/esm/string/url.js +0 -65
  295. package/esm/string/url.js.map +0 -1
package/dist/object.d.ts DELETED
@@ -1,59 +0,0 @@
1
- export declare const isNull: (object: string | number | {
2
- [key: string]: any;
3
- }) => boolean;
4
- export declare const toBool: (object: string | {
5
- [key: string]: any;
6
- } | null) => boolean;
7
- export declare const toInt: (object: string | number | {
8
- [key: string]: any;
9
- } | null) => number;
10
- export declare const toFloat: (object: string | {
11
- [key: string]: any;
12
- } | null) => number;
13
- export declare const toArray: (obj: {
14
- [key: string]: any;
15
- }) => {
16
- [key: string]: any;
17
- };
18
- /**
19
- * Convert value in object to array
20
- */
21
- export declare const objectToArray: (obj: {
22
- [key: string]: any;
23
- }) => any[];
24
- /**
25
- * Iterate through every keys & values of the object
26
- */
27
- export declare const iterate: (obj: {
28
- [key: string]: any;
29
- }, callbackFn: (obj: any, key?: string, value?: any) => any) => {
30
- [key: string]: any;
31
- };
32
- declare const xobject: {
33
- isNull: (object: string | number | {
34
- [key: string]: any;
35
- }) => boolean;
36
- toBool: (object: string | {
37
- [key: string]: any;
38
- } | null) => boolean;
39
- toInt: (object: string | number | {
40
- [key: string]: any;
41
- } | null) => number;
42
- toFloat: (object: string | {
43
- [key: string]: any;
44
- } | null) => number;
45
- toArray: (obj: {
46
- [key: string]: any;
47
- }) => {
48
- [key: string]: any;
49
- };
50
- objectToArray: (obj: {
51
- [key: string]: any;
52
- }) => any[];
53
- iterate: (obj: {
54
- [key: string]: any;
55
- }, callbackFn: (obj: any, key?: string, value?: any) => any) => {
56
- [key: string]: any;
57
- };
58
- };
59
- export default xobject;
package/dist/object.js DELETED
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.iterate = exports.objectToArray = exports.toArray = exports.toFloat = exports.toInt = exports.toBool = exports.isNull = void 0;
4
- const isNull = (object) => {
5
- if (typeof object == "undefined")
6
- return true;
7
- if (object == "")
8
- return true;
9
- if (Array.isArray(object))
10
- return object.length == 0;
11
- if (JSON.stringify(object) == "{}")
12
- return true;
13
- return object == null;
14
- };
15
- exports.isNull = isNull;
16
- const toBool = (object) => {
17
- if ((0, exports.isNull)(object || ""))
18
- return false;
19
- object = (object || "").toString();
20
- return object === "true" || (0, exports.toFloat)(object) != 0;
21
- };
22
- exports.toBool = toBool;
23
- const toInt = (object) => {
24
- if ((0, exports.isNull)(object || ""))
25
- return 0;
26
- object = (object || "").toString();
27
- return parseInt(object, 10);
28
- };
29
- exports.toInt = toInt;
30
- const toFloat = (object) => {
31
- if ((0, exports.isNull)(object || ""))
32
- return 0;
33
- object = (object || "").toString();
34
- return parseFloat(object);
35
- };
36
- exports.toFloat = toFloat;
37
- const toArray = (obj) => {
38
- if ((0, exports.isNull)(obj))
39
- return [];
40
- if (!Array.isArray(obj)) {
41
- obj = [obj];
42
- }
43
- return obj;
44
- };
45
- exports.toArray = toArray;
46
- /**
47
- * Convert value in object to array
48
- */
49
- const objectToArray = (obj) => {
50
- const array = [];
51
- for (const key in obj) {
52
- array.push(obj[key]);
53
- }
54
- return array;
55
- };
56
- exports.objectToArray = objectToArray;
57
- /**
58
- * Iterate through every keys & values of the object
59
- */
60
- const iterate = (obj, callbackFn) => {
61
- Object.keys(obj).forEach((key) => {
62
- const val = obj[key];
63
- callbackFn(obj, key, val);
64
- if (typeof val === "object" && val !== null)
65
- (0, exports.iterate)(val, callbackFn);
66
- });
67
- return obj;
68
- };
69
- exports.iterate = iterate;
70
- const xobject = {
71
- isNull: exports.isNull,
72
- toBool: exports.toBool,
73
- toInt: exports.toInt,
74
- toFloat: exports.toFloat,
75
- toArray: exports.toArray,
76
- objectToArray: exports.objectToArray,
77
- iterate: exports.iterate,
78
- };
79
- exports.default = xobject;
80
- //# sourceMappingURL=object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":";;;AAAO,MAAM,MAAM,GAAG,CAAC,MAAgD,EAAE,EAAE;IAC1E,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAC9C,IAAI,MAAM,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhD,OAAO,MAAM,IAAI,IAAI,CAAC;AACvB,CAAC,CAAC;AAPW,QAAA,MAAM,UAOjB;AAEK,MAAM,MAAM,GAAG,CAAC,MAA8C,EAAE,EAAE;IACxE,IAAI,IAAA,cAAM,EAAC,MAAM,IAAI,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,MAA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AI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;KACrB;IACD,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEF;;GAEG;AACI,MAAM,OAAO,GAAG,CAAC,GAA2B,EAAE,UAAwD,EAAE,EAAE;IAChH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;YAAE,IAAA,eAAO,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB;AAEF,MAAM,OAAO,GAAG;IACf,MAAM,EAAN,cAAM;IACN,MAAM,EAAN,cAAM;IACN,KAAK,EAAL,aAAK;IACL,OAAO,EAAP,eAAO;IACP,OAAO,EAAP,eAAO;IACP,aAAa,EAAb,qBAAa;IACb,OAAO,EAAP,eAAO;CACP,CAAC;AACF,kBAAe,OAAO,CAAC"}
@@ -1,8 +0,0 @@
1
- declare const permission: {
2
- requestCamera: ({ audio, video }: {
3
- audio?: boolean | undefined;
4
- video?: boolean | undefined;
5
- }) => false | Promise<unknown>;
6
- requestDeviceOrientationControl: () => false | Promise<unknown>;
7
- };
8
- export default permission;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const requestCamera_1 = require("./requestCamera");
4
- const requestDeviceOrientationControl_1 = require("./requestDeviceOrientationControl");
5
- const permission = { requestCamera: requestCamera_1.requestCamera, requestDeviceOrientationControl: requestDeviceOrientationControl_1.requestDeviceOrientationControl };
6
- exports.default = permission;
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":";;AAAA,mDAAgD;AAChD,uFAAoF;AAEpF,MAAM,UAAU,GAAG,EAAE,aAAa,EAAb,6BAAa,EAAE,+BAA+B,EAA/B,iEAA+B,EAAE,CAAC;AAEtE,kBAAe,UAAU,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const requestCamera: ({ audio, video }: {
2
- audio?: boolean | undefined;
3
- video?: boolean | undefined;
4
- }) => false | Promise<unknown>;
5
- export default requestCamera;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestCamera = void 0;
4
- const requestCamera = ({ audio = true, video = true }) => {
5
- if (typeof window == "undefined")
6
- return false;
7
- return new Promise((resolve, reject) => {
8
- // Older browsers might not implement mediaDevices at all, so we set an empty object first
9
- // if (navigator.mediaDevices === undefined) {
10
- // navigator.mediaDevices = {};
11
- // }
12
- // Some browsers partially implement mediaDevices. We can't just assign an object
13
- // with getUserMedia as it would overwrite existing properties.
14
- // Here, we will just add the getUserMedia property if it's missing.
15
- if (navigator.mediaDevices.getUserMedia === undefined) {
16
- navigator.mediaDevices.getUserMedia = function (constraints) {
17
- // First get ahold of the legacy getUserMedia, if present
18
- var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
19
- // Some browsers just don't implement it - return a rejected promise with an error
20
- // to keep a consistent interface
21
- if (!getUserMedia) {
22
- return Promise.reject(new Error("getUserMedia is not implemented in this browser"));
23
- }
24
- // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise
25
- return new Promise(function (resolve, reject) {
26
- getUserMedia.call(navigator, constraints, resolve, reject);
27
- });
28
- };
29
- }
30
- navigator.mediaDevices
31
- .getUserMedia({ audio, video })
32
- .then(function (stream) {
33
- resolve(true);
34
- })
35
- .catch(function (err) {
36
- console.log(err.name + ": " + err.message);
37
- resolve(false);
38
- });
39
- });
40
- };
41
- exports.requestCamera = requestCamera;
42
- exports.default = exports.requestCamera;
43
- //# sourceMappingURL=requestCamera.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestCamera.js","sourceRoot":"","sources":["../../src/permission/requestCamera.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,EAAE,EAAE;IAC/D,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,KAAK,CAAC;IAE/C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,0FAA0F;QAC1F,8CAA8C;QAC9C,gCAAgC;QAChC,IAAI;QAEJ,iFAAiF;QACjF,+DAA+D;QAC/D,oEAAoE;QACpE,IAAI,SAAS,CAAC,YAAY,CAAC,YAAY,KAAK,SAAS,EAAE;YACtD,SAAS,CAAC,YAAY,CAAC,YAAY,GAAG,UAAU,WAAW;gBAC1D,yDAAyD;gBACzD,IAAI,YAAY,GAAI,SAAiB,CAAC,kBAAkB,IAAK,SAAiB,CAAC,eAAe,CAAC;gBAE/F,kFAAkF;gBAClF,iCAAiC;gBACjC,IAAI,CAAC,YAAY,EAAE;oBAClB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC,CAAC;iBACpF;gBAED,4EAA4E;gBAC5E,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM;oBAC3C,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;SACF;QAED,SAAS,CAAC,YAAY;aACpB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aAC9B,IAAI,CAAC,UAAU,MAAM;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC;aACD,KAAK,CAAC,UAAU,GAAG;YACnB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,aAAa,iBAwCxB;AAEF,kBAAe,qBAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const requestDeviceOrientationControl: () => false | Promise<unknown>;
2
- export default requestDeviceOrientationControl;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestDeviceOrientationControl = void 0;
4
- const device_1 = require("../device");
5
- const requestDeviceOrientationControl = () => {
6
- if (typeof window == "undefined")
7
- return false;
8
- return new Promise((resolve, reject) => {
9
- if ((0, device_1.isAndroid)())
10
- resolve(true);
11
- if (typeof DeviceMotionEvent != "undefined" && DeviceMotionEvent.requestPermission) {
12
- // (optional) Do something before API request prompt.
13
- DeviceMotionEvent
14
- .requestPermission()
15
- .then((response) => {
16
- // (optional) Do something after API prompt dismissed.
17
- if (response == "granted") {
18
- resolve(true);
19
- // resolve({ status: true })
20
- }
21
- else {
22
- resolve(false);
23
- // resolve({ status: false, reason: "DeviceMotionEvent is not support" })
24
- }
25
- })
26
- .catch((response) => {
27
- resolve(false);
28
- // resolve({ status: false, reason: response })
29
- });
30
- }
31
- else {
32
- resolve(false);
33
- // resolve({ status: false, reason: "DeviceMotionEvent is not defined" })
34
- }
35
- });
36
- };
37
- exports.requestDeviceOrientationControl = requestDeviceOrientationControl;
38
- exports.default = exports.requestDeviceOrientationControl;
39
- //# sourceMappingURL=requestDeviceOrientationControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestDeviceOrientationControl.js","sourceRoot":"","sources":["../../src/permission/requestDeviceOrientationControl.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AAE/B,MAAM,+BAA+B,GAAG,GAAG,EAAE;IACnD,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAI,IAAA,kBAAS,GAAE;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,OAAO,iBAAiB,IAAI,WAAW,IAAK,iBAAyB,CAAC,iBAAiB,EAAE;YAC5F,qDAAqD;YACpD,iBAAyB;iBACxB,iBAAiB,EAAE;iBACnB,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE;gBACvB,sDAAsD;gBACtD,IAAI,QAAQ,IAAI,SAAS,EAAE;oBAC1B,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,4BAA4B;iBAC5B;qBAAM;oBACN,OAAO,CAAC,KAAK,CAAC,CAAC;oBACf,yEAAyE;iBACzE;YACF,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,QAAa,EAAE,EAAE;gBACxB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,+CAA+C;YAChD,CAAC,CAAC,CAAC;SACJ;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,yEAAyE;SACzE;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,+BAA+B,mCA4B1C;AAEF,kBAAe,uCAA+B,CAAC"}
@@ -1,49 +0,0 @@
1
- export declare const getResponse: () => {
2
- status: number;
3
- messages: never[];
4
- data: null;
5
- };
6
- export declare const getSuccessResponse: (data: any, message?: string) => {
7
- status: number;
8
- messages: string[];
9
- data: any;
10
- };
11
- export declare const getFailedResponse: (...messages: any[]) => {
12
- status: number;
13
- error: boolean;
14
- messages: any[];
15
- data: null;
16
- };
17
- export declare const Response: {
18
- send: (res: any, data?: any) => any;
19
- succeed: (res: any, data?: any) => any;
20
- failed: (res: any, ...messages: string[]) => any;
21
- rejected: (res: any, message?: string) => any;
22
- ignore: (res: any, message?: string) => any;
23
- };
24
- declare const response: {
25
- getResponse: () => {
26
- status: number;
27
- messages: never[];
28
- data: null;
29
- };
30
- getSuccessResponse: (data: any, message?: string) => {
31
- status: number;
32
- messages: string[];
33
- data: any;
34
- };
35
- getFailedResponse: (...messages: any[]) => {
36
- status: number;
37
- error: boolean;
38
- messages: any[];
39
- data: null;
40
- };
41
- Response: {
42
- send: (res: any, data?: any) => any;
43
- succeed: (res: any, data?: any) => any;
44
- failed: (res: any, ...messages: string[]) => any;
45
- rejected: (res: any, message?: string) => any;
46
- ignore: (res: any, message?: string) => any;
47
- };
48
- };
49
- export default response;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Response = exports.getFailedResponse = exports.getSuccessResponse = exports.getResponse = void 0;
4
- const log_1 = require("../console/log");
5
- const getResponse = () => {
6
- return { status: 0, messages: [], data: null };
7
- };
8
- exports.getResponse = getResponse;
9
- const getSuccessResponse = (data, message) => {
10
- return { status: 1, messages: message ? [message] : [], data: data || true };
11
- };
12
- exports.getSuccessResponse = getSuccessResponse;
13
- const getFailedResponse = (...messages) => {
14
- if (!messages)
15
- messages = ["What's do you want?"];
16
- return { status: 0, error: true, messages: [...messages], data: null };
17
- };
18
- exports.getFailedResponse = getFailedResponse;
19
- exports.Response = {
20
- send: (res, data = {}) => {
21
- if (res.locals.logEnabled)
22
- (0, log_1.logRes)(res, data);
23
- if (data.error)
24
- return exports.Response.failed(res, data.error);
25
- return exports.Response.succeed(res, data);
26
- },
27
- succeed: (res, data = {}) => {
28
- if (res.locals.logEnabled)
29
- (0, log_1.logRes)(res, data);
30
- return res.status(200).json((0, exports.getSuccessResponse)(data));
31
- },
32
- failed: (res, ...messages) => {
33
- if (res.locals.logEnabled)
34
- (0, log_1.logRes)(res, ...messages);
35
- return res.status(200).json((0, exports.getFailedResponse)(...messages));
36
- },
37
- rejected: (res, message) => {
38
- const msg = message ? message : "Permissions denied.";
39
- if (res.locals.logEnabled)
40
- (0, log_1.logRes)(res, { message: msg });
41
- return res.status(403).json((0, exports.getFailedResponse)(msg));
42
- },
43
- ignore: (res, message) => {
44
- const msg = message ? message : "What do you want?";
45
- if (res.locals.logEnabled)
46
- (0, log_1.logRes)(res, { statusCode: 404, message: msg });
47
- return res.status(200).json((0, exports.getFailedResponse)(msg));
48
- },
49
- };
50
- const response = { getResponse: exports.getResponse, getSuccessResponse: exports.getSuccessResponse, getFailedResponse: exports.getFailedResponse, Response: exports.Response };
51
- exports.default = response;
52
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/response/index.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAEjC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEK,MAAM,kBAAkB,GAAG,CAAC,IAAS,EAAE,OAAgB,EAAE,EAAE;IACjE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;AAC9E,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,iBAAiB,GAAG,CAAC,GAAG,QAAe,EAAE,EAAE;IACvD,IAAI,CAAC,QAAQ;QAAE,QAAQ,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxE,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B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AG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,yBAAiB,EAAC,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,EAAE,CAAC,GAAQ,EAAE,OAAgB,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACpD,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU;YAAE,IAAA,YAAM,EAAC,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1E,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,yBAAiB,EAAC,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;CACD,CAAC;AAEF,MAAM,QAAQ,GAAG,EAAE,WAAW,EAAX,mBAAW,EAAE,kBAAkB,EAAlB,0BAAkB,EAAE,iBAAiB,EAAjB,yBAAiB,EAAE,QAAQ,EAAR,gBAAQ,EAAE,CAAC;AAElF,kBAAe,QAAQ,CAAC"}
@@ -1,4 +0,0 @@
1
- export default function convertPathnameAndQuery(url: string): {
2
- pathname: string;
3
- query: any;
4
- } | null;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const object_1 = require("../object");
4
- function convertPathnameAndQuery(url) {
5
- //
6
- if ((0, object_1.isNull)(url))
7
- return null;
8
- url = url.toString();
9
- const arr = url.split("?");
10
- const pathname = arr[0];
11
- const query = {};
12
- if (arr[1]) {
13
- const _query = arr[1].split("&");
14
- _query.map((item) => {
15
- const __item = item.split("=");
16
- query[__item[0]] = __item[1];
17
- });
18
- }
19
- return {
20
- pathname,
21
- query,
22
- };
23
- }
24
- exports.default = convertPathnameAndQuery;
25
- //# sourceMappingURL=convertPathnameAndQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertPathnameAndQuery.js","sourceRoot":"","sources":["../../src/string/convertPathnameAndQuery.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,SAAwB,uBAAuB,CAAC,GAAW;IAC1D,EAAE;IACF,IAAI,IAAA,eAAM,EAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAErB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAS,CAAC;IAExB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;KACH;IAED,OAAO;QACN,QAAQ;QACR,KAAK;KACL,CAAC;AACH,CAAC;AAtBD,0CAsBC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Format the input number with commas
3
- * @example 1000000 -> 1,000,000
4
- */
5
- export declare function formatNumber(num: number, prefix?: string): string;
6
- export default formatNumber;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatNumber = void 0;
4
- const object_1 = require("../object");
5
- /**
6
- * Format the input number with commas
7
- * @example 1000000 -> 1,000,000
8
- */
9
- function formatNumber(num, prefix = "$") {
10
- const numRound = Math.round(((0, object_1.toInt)(num) + Number.EPSILON) * 100) / 100;
11
- return Number.isNaN(numRound) ? "0" : "" + numRound.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, prefix + "1,");
12
- }
13
- exports.formatNumber = formatNumber;
14
- exports.default = formatNumber;
15
- //# sourceMappingURL=formatNumber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatNumber.js","sourceRoot":"","sources":["../../src/string/formatNumber.ts"],"names":[],"mappings":";;;AAAA,sCAAkC;AAElC;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAW,EAAE,MAAM,GAAG,GAAG;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAA,cAAK,EAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACvE,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAClH,CAAC;AAHD,oCAGC;AAED,kBAAe,YAAY,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * random password
3
- * - if hard = true -> random punctuation inside
4
- * @param {*} length
5
- * @param {Boolean} hard
6
- * @returns
7
- */
8
- export declare function generatePassword(length?: number, hard?: boolean): string;
9
- export default generatePassword;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generatePassword = void 0;
4
- const random_1 = require("./random");
5
- /**
6
- * random password
7
- * - if hard = true -> random punctuation inside
8
- * @param {*} length
9
- * @param {Boolean} hard
10
- * @returns
11
- */
12
- function generatePassword(length = 6, hard = true) {
13
- if (!Number.isFinite(length))
14
- length = 6;
15
- if (length <= 0)
16
- length = 6;
17
- let pass = (0, random_1.randomStringByLength)(length, random_1.textLowCase + random_1.textLowCase.toUpperCase() + random_1.numeric);
18
- if (hard)
19
- pass = pass.replace(pass[Math.floor(pass.length / 2)], (0, random_1.randomStringByLength)(1, random_1.punctuation));
20
- return pass;
21
- }
22
- exports.generatePassword = generatePassword;
23
- exports.default = generatePassword;
24
- //# sourceMappingURL=generatePassword.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generatePassword.js","sourceRoot":"","sources":["../../src/string/generatePassword.ts"],"names":[],"mappings":";;;AAAA,qCAAmF;AAEnF;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI;IACvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,MAAM,GAAG,CAAC,CAAC;IACzC,IAAI,MAAM,IAAI,CAAC;QAAE,MAAM,GAAG,CAAC,CAAC;IAC5B,IAAI,IAAI,GAAG,IAAA,6BAAoB,EAAC,MAAM,EAAE,oBAAW,GAAG,oBAAW,CAAC,WAAW,EAAE,GAAG,gBAAO,CAAC,CAAC;IAC3F,IAAI,IAAI;QAAE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,IAAA,6BAAoB,EAAC,CAAC,EAAE,oBAAW,CAAC,CAAC,CAAC;IACvG,OAAO,IAAI,CAAC;AACb,CAAC;AAND,4CAMC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function generateUUID(): string;
2
- export default generateUUID;
@@ -1,37 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateUUID.js","sourceRoot":"","sources":["../../src/string/generateUUID.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,MAAM,IAAI,GAAG,CAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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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 +0,0 @@
1
- export default function getTextBetweenCharByIndex(str: string, char: any, index: Number): string;
@@ -1,21 +0,0 @@
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
- const indexesOf_1 = __importDefault(require("./indexesOf"));
7
- function getTextBetweenCharByIndex(str, char, index) {
8
- const arr = (0, indexesOf_1.default)(str, char);
9
- let start = 0, end = 0;
10
- for (let i = 0; i < arr.length; i++) {
11
- const _index = arr[i];
12
- if (index > _index) {
13
- start = _index;
14
- end = arr[i + 1];
15
- }
16
- }
17
- const result = str.substring(start + 1, end);
18
- return result;
19
- }
20
- exports.default = getTextBetweenCharByIndex;
21
- //# sourceMappingURL=getTextBetweenCharByIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTextBetweenCharByIndex.js","sourceRoot":"","sources":["../../src/string/getTextBetweenCharByIndex.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAEpC,SAAwB,yBAAyB,CAAC,GAAW,EAAE,IAAS,EAAE,KAAa;IACtF,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEjC,IAAI,KAAK,GAAG,CAAC,EACZ,GAAG,GAAG,CAAC,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEtB,IAAI,KAAK,GAAG,MAAM,EAAE;YACnB,KAAK,GAAG,MAAM,CAAC;YACf,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACjB;KACD;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC;AACf,CAAC;AAjBD,4CAiBC"}
@@ -1,65 +0,0 @@
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;
61
- getFileNameWithExtension: (url: string) => string;
62
- getFileExtension: (url: string) => string | null | undefined;
63
- isImage: (url: string) => boolean;
64
- };
65
- export default xstring;