diginext-utils 2.1.20 → 2.1.21

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
package/dist/color.js CHANGED
@@ -1,96 +1,96 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hexToVBColor = exports.RGBToHex = exports.hexLighten = exports.hexDarken = exports.hexToRgb = exports.pSBC = exports.random = void 0;
4
- const random = (hex = false) => {
5
- return (hex ? "#" : "") + Math.floor(Math.random() * 16777215).toString(16);
6
- };
7
- exports.random = random;
8
- // This function (pSBC) will take a HEX or RGB web color.
9
- // pSBC can shade it darker or lighter, or blend it with a second color, and can also pass it right thru but convert from Hex to RGB (Hex2RGB) or RGB to Hex (RGB2Hex).
10
- // All without you even knowing what color format you are using.
11
- // Version 4.0 (pref: https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js));
12
- const pSBC = (p, c0, c1, l) => {
13
- let r, g, b, P, f, t, h, i = parseInt, m = Math.round, a = typeof c1 == "string";
14
- if (typeof p != "number" || p < -1 || p > 1 || typeof c0 != "string" || (c0[0] != "r" && c0[0] != "#") || (c1 && !a))
15
- return null;
16
- const pSBCr = (d) => {
17
- let n = d.length, x = { r: 0, g: 0, b: 0, a: 1 };
18
- if (n > 9) {
19
- ([r, g, b, a] = d = d.split(",")), (n = d.length);
20
- if (n < 3 || n > 4)
21
- return null;
22
- (x.r = i(r[3] == "a" ? r.slice(5) : r.slice(4))), (x.g = i(g)), (x.b = i(b)), (x.a = a ? parseFloat(a.toString()) : -1);
23
- }
24
- else {
25
- if (n == 8 || n == 6 || n < 4)
26
- return null;
27
- if (n < 6)
28
- d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : "");
29
- d = i(d.slice(1), 16);
30
- if (n == 9 || n == 5)
31
- (x.r = (d >> 24) & 255), (x.g = (d >> 16) & 255), (x.b = (d >> 8) & 255), (x.a = m((d & 255) / 0.255) / 1000);
32
- else
33
- (x.r = d >> 16), (x.g = (d >> 8) & 255), (x.b = d & 255), (x.a = -1);
34
- }
35
- return x;
36
- };
37
- (h = c0.length > 9),
38
- (h = a ? (c1.length > 9 ? true : c1 == "c" ? !h : false) : h),
39
- (f = pSBCr(c0)),
40
- (P = p < 0),
41
- (t = c1 && c1 != "c" ? pSBCr(c1) : P ? { r: 0, g: 0, b: 0, a: -1 } : { r: 255, g: 255, b: 255, a: -1 }),
42
- (p = P ? p * -1 : p),
43
- (P = 1 - p);
44
- if (!f || !t || typeof f == "undefined")
45
- return null;
46
- else if (l)
47
- (r = m(P * f.r + p * t.r)), (g = m(P * f.g + p * t.g)), (b = m(P * f.b + p * t.b));
48
- else
49
- (r = m((P * f.r ** 2 + p * t.r ** 2) ** 0.5)), (g = m((P * f.g ** 2 + p * t.g ** 2) ** 0.5)), (b = m((P * f.b ** 2 + p * t.b ** 2) ** 0.5));
50
- (a = f.a), (t = t.a), (f = a >= 0 || t >= 0), (a = f ? (a < 0 ? t : t < 0 ? a : a * P + t * p) : 0);
51
- if (h)
52
- return "rgb" + (f ? "a(" : "(") + r + "," + g + "," + b + (f ? "," + m(a * 1000) / 1000 : "") + ")";
53
- else
54
- return "#" + (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)).toString(16).slice(1, f ? undefined : -2);
55
- };
56
- exports.pSBC = pSBC;
57
- const hexToRgb = (hex) => {
58
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
59
- return result
60
- ? {
61
- r: parseInt(result[1], 16),
62
- g: parseInt(result[2], 16),
63
- b: parseInt(result[3], 16),
64
- }
65
- : null;
66
- };
67
- exports.hexToRgb = hexToRgb;
68
- const hexDarken = (hex, amount) => {
69
- return (0, exports.pSBC)(-amount, hex);
70
- };
71
- exports.hexDarken = hexDarken;
72
- const hexLighten = (hex, amount) => {
73
- return (0, exports.pSBC)(amount, hex);
74
- };
75
- exports.hexLighten = hexLighten;
76
- const RGBToHex = (rgb) => {
77
- return (0, exports.pSBC)(0, rgb, "c", true);
78
- };
79
- exports.RGBToHex = RGBToHex;
80
- const hexToVBColor = (rrggbb) => {
81
- rrggbb = rrggbb.replace("#", "");
82
- const bbggrr = rrggbb.substring(4, 2) + rrggbb.substring(2, 2) + rrggbb.substring(0, 2);
83
- return parseInt(bbggrr, 16);
84
- };
85
- exports.hexToVBColor = hexToVBColor;
86
- const color = {
87
- random: exports.random,
88
- pSBC: exports.pSBC,
89
- hexToRgb: exports.hexToRgb,
90
- hexDarken: exports.hexDarken,
91
- hexLighten: exports.hexLighten,
92
- RGBToHex: exports.RGBToHex,
93
- hexToVBColor: exports.hexToVBColor,
94
- };
95
- exports.default = color;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hexToVBColor = exports.RGBToHex = exports.hexLighten = exports.hexDarken = exports.hexToRgb = exports.pSBC = exports.random = void 0;
4
+ const random = (hex = false) => {
5
+ return (hex ? "#" : "") + Math.floor(Math.random() * 16777215).toString(16);
6
+ };
7
+ exports.random = random;
8
+ // This function (pSBC) will take a HEX or RGB web color.
9
+ // pSBC can shade it darker or lighter, or blend it with a second color, and can also pass it right thru but convert from Hex to RGB (Hex2RGB) or RGB to Hex (RGB2Hex).
10
+ // All without you even knowing what color format you are using.
11
+ // Version 4.0 (pref: https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js));
12
+ const pSBC = (p, c0, c1, l) => {
13
+ let r, g, b, P, f, t, h, i = parseInt, m = Math.round, a = typeof c1 == "string";
14
+ if (typeof p != "number" || p < -1 || p > 1 || typeof c0 != "string" || (c0[0] != "r" && c0[0] != "#") || (c1 && !a))
15
+ return null;
16
+ const pSBCr = (d) => {
17
+ let n = d.length, x = { r: 0, g: 0, b: 0, a: 1 };
18
+ if (n > 9) {
19
+ ([r, g, b, a] = d = d.split(",")), (n = d.length);
20
+ if (n < 3 || n > 4)
21
+ return null;
22
+ (x.r = i(r[3] == "a" ? r.slice(5) : r.slice(4))), (x.g = i(g)), (x.b = i(b)), (x.a = a ? parseFloat(a.toString()) : -1);
23
+ }
24
+ else {
25
+ if (n == 8 || n == 6 || n < 4)
26
+ return null;
27
+ if (n < 6)
28
+ d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : "");
29
+ d = i(d.slice(1), 16);
30
+ if (n == 9 || n == 5)
31
+ (x.r = (d >> 24) & 255), (x.g = (d >> 16) & 255), (x.b = (d >> 8) & 255), (x.a = m((d & 255) / 0.255) / 1000);
32
+ else
33
+ (x.r = d >> 16), (x.g = (d >> 8) & 255), (x.b = d & 255), (x.a = -1);
34
+ }
35
+ return x;
36
+ };
37
+ (h = c0.length > 9),
38
+ (h = a ? (c1.length > 9 ? true : c1 == "c" ? !h : false) : h),
39
+ (f = pSBCr(c0)),
40
+ (P = p < 0),
41
+ (t = c1 && c1 != "c" ? pSBCr(c1) : P ? { r: 0, g: 0, b: 0, a: -1 } : { r: 255, g: 255, b: 255, a: -1 }),
42
+ (p = P ? p * -1 : p),
43
+ (P = 1 - p);
44
+ if (!f || !t || typeof f == "undefined")
45
+ return null;
46
+ else if (l)
47
+ (r = m(P * f.r + p * t.r)), (g = m(P * f.g + p * t.g)), (b = m(P * f.b + p * t.b));
48
+ else
49
+ (r = m((P * f.r ** 2 + p * t.r ** 2) ** 0.5)), (g = m((P * f.g ** 2 + p * t.g ** 2) ** 0.5)), (b = m((P * f.b ** 2 + p * t.b ** 2) ** 0.5));
50
+ (a = f.a), (t = t.a), (f = a >= 0 || t >= 0), (a = f ? (a < 0 ? t : t < 0 ? a : a * P + t * p) : 0);
51
+ if (h)
52
+ return "rgb" + (f ? "a(" : "(") + r + "," + g + "," + b + (f ? "," + m(a * 1000) / 1000 : "") + ")";
53
+ else
54
+ return "#" + (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)).toString(16).slice(1, f ? undefined : -2);
55
+ };
56
+ exports.pSBC = pSBC;
57
+ const hexToRgb = (hex) => {
58
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
59
+ return result
60
+ ? {
61
+ r: parseInt(result[1], 16),
62
+ g: parseInt(result[2], 16),
63
+ b: parseInt(result[3], 16),
64
+ }
65
+ : null;
66
+ };
67
+ exports.hexToRgb = hexToRgb;
68
+ const hexDarken = (hex, amount) => {
69
+ return (0, exports.pSBC)(-amount, hex);
70
+ };
71
+ exports.hexDarken = hexDarken;
72
+ const hexLighten = (hex, amount) => {
73
+ return (0, exports.pSBC)(amount, hex);
74
+ };
75
+ exports.hexLighten = hexLighten;
76
+ const RGBToHex = (rgb) => {
77
+ return (0, exports.pSBC)(0, rgb, "c", true);
78
+ };
79
+ exports.RGBToHex = RGBToHex;
80
+ const hexToVBColor = (rrggbb) => {
81
+ rrggbb = rrggbb.replace("#", "");
82
+ const bbggrr = rrggbb.substring(4, 2) + rrggbb.substring(2, 2) + rrggbb.substring(0, 2);
83
+ return parseInt(bbggrr, 16);
84
+ };
85
+ exports.hexToVBColor = hexToVBColor;
86
+ const color = {
87
+ random: exports.random,
88
+ pSBC: exports.pSBC,
89
+ hexToRgb: exports.hexToRgb,
90
+ hexDarken: exports.hexDarken,
91
+ hexLighten: exports.hexLighten,
92
+ RGBToHex: exports.RGBToHex,
93
+ hexToVBColor: exports.hexToVBColor,
94
+ };
95
+ exports.default = color;
96
96
  //# sourceMappingURL=color.js.map
@@ -1,2 +1,2 @@
1
- export declare function enableConsole(): Console;
2
- export default enableConsole;
1
+ export declare function enableConsole(): Console;
2
+ export default enableConsole;
@@ -1,14 +1,14 @@
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.enableConsole = void 0;
7
- const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
8
- const _console = (0, cloneDeep_1.default)(console);
9
- function enableConsole() {
10
- return _console;
11
- }
12
- exports.enableConsole = enableConsole;
13
- exports.default = enableConsole;
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.enableConsole = void 0;
7
+ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
8
+ const _console = (0, cloneDeep_1.default)(console);
9
+ function enableConsole() {
10
+ return _console;
11
+ }
12
+ exports.enableConsole = enableConsole;
13
+ exports.default = enableConsole;
14
14
  //# sourceMappingURL=enableConsole.js.map
@@ -1,11 +1,11 @@
1
- export declare const disableConsole: () => void;
2
- export declare const removeConsole: () => void;
3
- export declare const showCredit: () => void;
4
- import { enableConsole } from "./enableConsole";
5
- declare const xconsole: {
6
- enableConsole: typeof enableConsole;
7
- disableConsole: () => void;
8
- removeConsole: () => void;
9
- showCredit: () => void;
10
- };
11
- export default xconsole;
1
+ export declare const disableConsole: () => void;
2
+ export declare const removeConsole: () => void;
3
+ export declare const showCredit: () => void;
4
+ import { enableConsole } from "./enableConsole";
5
+ declare const xconsole: {
6
+ enableConsole: typeof enableConsole;
7
+ disableConsole: () => void;
8
+ removeConsole: () => void;
9
+ showCredit: () => void;
10
+ };
11
+ export default xconsole;
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.showCredit = exports.removeConsole = exports.disableConsole = void 0;
4
- const disableConsole = () => {
5
- for (var key in console) {
6
- console[key] = function () { };
7
- }
8
- };
9
- exports.disableConsole = disableConsole;
10
- exports.removeConsole = exports.disableConsole;
11
- const showCredit = () => {
12
- console.log("Developed by Digitop | https://www.wearetopgroup.com/?utm_src=console");
13
- };
14
- exports.showCredit = showCredit;
15
- const enableConsole_1 = require("./enableConsole");
16
- const xconsole = { enableConsole: enableConsole_1.enableConsole, disableConsole: exports.disableConsole, removeConsole: exports.removeConsole, showCredit: exports.showCredit };
17
- exports.default = xconsole;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.showCredit = exports.removeConsole = exports.disableConsole = void 0;
4
+ const disableConsole = () => {
5
+ for (var key in console) {
6
+ console[key] = function () { };
7
+ }
8
+ };
9
+ exports.disableConsole = disableConsole;
10
+ exports.removeConsole = exports.disableConsole;
11
+ const showCredit = () => {
12
+ console.log("Developed by Digitop | https://www.wearetopgroup.com/?utm_src=console");
13
+ };
14
+ exports.showCredit = showCredit;
15
+ const enableConsole_1 = require("./enableConsole");
16
+ const xconsole = { enableConsole: enableConsole_1.enableConsole, disableConsole: exports.disableConsole, removeConsole: exports.removeConsole, showCredit: exports.showCredit };
17
+ exports.default = xconsole;
18
18
  //# sourceMappingURL=index.js.map
@@ -1,15 +1,15 @@
1
- export declare const log: (...msg: any) => any;
2
- export declare const logFull: (data?: {}) => {};
3
- export declare const logRes: (res: any, ...msg: any[]) => any[];
4
- export declare const logError: (...msg: any[]) => any[];
5
- export declare const logWarn: (...msg: any[]) => any[];
6
- export declare const logSuccess: (...msg: any[]) => any[];
7
- declare const xlog: {
8
- log: (...msg: any) => any;
9
- logFull: (data?: {}) => {};
10
- logRes: (res: any, ...msg: any[]) => any[];
11
- logError: (...msg: any[]) => any[];
12
- logWarn: (...msg: any[]) => any[];
13
- logSuccess: (...msg: any[]) => any[];
14
- };
15
- export default xlog;
1
+ export declare const log: (...msg: any) => any;
2
+ export declare const logFull: (data?: {}) => {};
3
+ export declare const logRes: (res: any, ...msg: any[]) => any[];
4
+ export declare const logError: (...msg: any[]) => any[];
5
+ export declare const logWarn: (...msg: any[]) => any[];
6
+ export declare const logSuccess: (...msg: any[]) => any[];
7
+ declare const xlog: {
8
+ log: (...msg: any) => any;
9
+ logFull: (data?: {}) => {};
10
+ logRes: (res: any, ...msg: any[]) => any[];
11
+ logError: (...msg: any[]) => any[];
12
+ logWarn: (...msg: any[]) => any[];
13
+ logSuccess: (...msg: any[]) => any[];
14
+ };
15
+ export default xlog;
@@ -1,45 +1,45 @@
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.logSuccess = exports.logWarn = exports.logError = exports.logRes = exports.logFull = exports.log = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const dayjs_1 = __importDefault(require("dayjs"));
9
- const log = (...msg) => {
10
- console.log(chalk_1.default.bgBlue.white(`[LOGGING ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
11
- return msg;
12
- };
13
- exports.log = log;
14
- const logFull = (data = {}) => {
15
- console.dir(data, { depth: null, colors: true, maxArrayLength: null });
16
- return data;
17
- };
18
- exports.logFull = logFull;
19
- const logRes = (res, ...msg) => {
20
- var _a, _b;
21
- /**
22
- * res.locals.req = Express Request
23
- */
24
- console.warn(chalk_1.default.blue(`[${res.statusCode}] ${((_a = res.locals.req) === null || _a === void 0 ? void 0 : _a.originalUrl) || "UNKNOWN_PATH"} >> ${(_b = res.locals.req) === null || _b === void 0 ? void 0 : _b.method} >>`), ...msg);
25
- return msg;
26
- };
27
- exports.logRes = logRes;
28
- const logError = (...msg) => {
29
- console.error(chalk_1.default.bgRed.white(`[ERROR ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), chalk_1.default.red(...msg));
30
- return msg;
31
- };
32
- exports.logError = logError;
33
- const logWarn = (...msg) => {
34
- console.warn(chalk_1.default.bgYellow.black(`[WARNING ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
35
- return msg;
36
- };
37
- exports.logWarn = logWarn;
38
- const logSuccess = (...msg) => {
39
- console.info(chalk_1.default.bgGreen.black(`[SUCCESS ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
40
- return msg;
41
- };
42
- exports.logSuccess = logSuccess;
43
- const xlog = { log: exports.log, logFull: exports.logFull, logRes: exports.logRes, logError: exports.logError, logWarn: exports.logWarn, logSuccess: exports.logSuccess };
44
- exports.default = xlog;
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.logSuccess = exports.logWarn = exports.logError = exports.logRes = exports.logFull = exports.log = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const dayjs_1 = __importDefault(require("dayjs"));
9
+ const log = (...msg) => {
10
+ console.log(chalk_1.default.bgBlue.white(`[LOGGING ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
11
+ return msg;
12
+ };
13
+ exports.log = log;
14
+ const logFull = (data = {}) => {
15
+ console.dir(data, { depth: null, colors: true, maxArrayLength: null });
16
+ return data;
17
+ };
18
+ exports.logFull = logFull;
19
+ const logRes = (res, ...msg) => {
20
+ var _a, _b;
21
+ /**
22
+ * res.locals.req = Express Request
23
+ */
24
+ console.warn(chalk_1.default.blue(`[${res.statusCode}] ${((_a = res.locals.req) === null || _a === void 0 ? void 0 : _a.originalUrl) || "UNKNOWN_PATH"} >> ${(_b = res.locals.req) === null || _b === void 0 ? void 0 : _b.method} >>`), ...msg);
25
+ return msg;
26
+ };
27
+ exports.logRes = logRes;
28
+ const logError = (...msg) => {
29
+ console.error(chalk_1.default.bgRed.white(`[ERROR ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), chalk_1.default.red(...msg));
30
+ return msg;
31
+ };
32
+ exports.logError = logError;
33
+ const logWarn = (...msg) => {
34
+ console.warn(chalk_1.default.bgYellow.black(`[WARNING ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
35
+ return msg;
36
+ };
37
+ exports.logWarn = logWarn;
38
+ const logSuccess = (...msg) => {
39
+ console.info(chalk_1.default.bgGreen.black(`[SUCCESS ${(0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss")}]`), ...msg);
40
+ return msg;
41
+ };
42
+ exports.logSuccess = logSuccess;
43
+ const xlog = { log: exports.log, logFull: exports.logFull, logRes: exports.logRes, logError: exports.logError, logWarn: exports.logWarn, logSuccess: exports.logSuccess };
44
+ exports.default = xlog;
45
45
  //# sourceMappingURL=log.js.map
@@ -1,5 +1,5 @@
1
- export declare const isPotrait: () => boolean;
2
- export declare const isLandscape: () => boolean;
3
- export declare const ua: () => any;
4
- export declare const isFacebookWebview: () => boolean | undefined;
5
- export declare const isInAppWebview: () => boolean;
1
+ export declare const isPotrait: () => boolean;
2
+ export declare const isLandscape: () => boolean;
3
+ export declare const ua: () => any;
4
+ export declare const isFacebookWebview: () => boolean | undefined;
5
+ export declare const isInAppWebview: () => boolean;
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isInAppWebview = exports.isFacebookWebview = exports.ua = exports.isLandscape = exports.isPotrait = void 0;
4
- const isPotrait = () => {
5
- if (typeof window == "undefined")
6
- return false;
7
- if (!window.orientation)
8
- return window.matchMedia("(orientation: portrait)").matches;
9
- return !(window.orientation === 90 || window.orientation === -90);
10
- };
11
- exports.isPotrait = isPotrait;
12
- const isLandscape = () => {
13
- return !(0, exports.isPotrait)();
14
- };
15
- exports.isLandscape = isLandscape;
16
- const ua = () => {
17
- if (typeof navigator == "undefined")
18
- return null;
19
- if (typeof window == "undefined")
20
- return null;
21
- return navigator.userAgent || navigator.vendor || window.opera;
22
- };
23
- exports.ua = ua;
24
- const isFacebookWebview = () => {
25
- var ua = ua();
26
- if (typeof ua != "undefined")
27
- return ua.indexOf("FBAN") > -1 || ua.indexOf("FBAV") > -1;
28
- };
29
- exports.isFacebookWebview = isFacebookWebview;
30
- const isInAppWebview = () => {
31
- const rules = ["WebView", "(iPhone|iPod|iPad)(?!.*Safari/)", "Android.*(wv|.0.0.0)"];
32
- const regex = new RegExp(`(${rules.join("|")})`, "ig");
33
- if ((0, exports.ua)())
34
- return Boolean((0, exports.ua)().match(regex));
35
- return false;
36
- };
37
- exports.isInAppWebview = isInAppWebview;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInAppWebview = exports.isFacebookWebview = exports.ua = exports.isLandscape = exports.isPotrait = void 0;
4
+ const isPotrait = () => {
5
+ if (typeof window == "undefined")
6
+ return false;
7
+ if (!window.orientation)
8
+ return window.matchMedia("(orientation: portrait)").matches;
9
+ return !(window.orientation === 90 || window.orientation === -90);
10
+ };
11
+ exports.isPotrait = isPotrait;
12
+ const isLandscape = () => {
13
+ return !(0, exports.isPotrait)();
14
+ };
15
+ exports.isLandscape = isLandscape;
16
+ const ua = () => {
17
+ if (typeof navigator == "undefined")
18
+ return null;
19
+ if (typeof window == "undefined")
20
+ return null;
21
+ return navigator.userAgent || navigator.vendor || window.opera;
22
+ };
23
+ exports.ua = ua;
24
+ const isFacebookWebview = () => {
25
+ var ua = ua();
26
+ if (typeof ua != "undefined")
27
+ return ua.indexOf("FBAN") > -1 || ua.indexOf("FBAV") > -1;
28
+ };
29
+ exports.isFacebookWebview = isFacebookWebview;
30
+ const isInAppWebview = () => {
31
+ const rules = ["WebView", "(iPhone|iPod|iPad)(?!.*Safari/)", "Android.*(wv|.0.0.0)"];
32
+ const regex = new RegExp(`(${rules.join("|")})`, "ig");
33
+ if ((0, exports.ua)())
34
+ return Boolean((0, exports.ua)().match(regex));
35
+ return false;
36
+ };
37
+ exports.isInAppWebview = isInAppWebview;
38
38
  //# sourceMappingURL=browser.js.map
@@ -1,7 +1,7 @@
1
- type GetWebcamParams = {
2
- container?: HTMLElement;
3
- facingMode: string;
4
- audio: boolean;
5
- };
6
- export declare function getWebcam(params?: GetWebcamParams): Promise<unknown> | undefined;
7
- export {};
1
+ type GetWebcamParams = {
2
+ container?: HTMLElement;
3
+ facingMode: string;
4
+ audio: boolean;
5
+ };
6
+ export declare function getWebcam(params?: GetWebcamParams): Promise<unknown> | undefined;
7
+ export {};