diginext-utils 3.0.5 → 3.0.7

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 (79) hide show
  1. package/dist/Checker.d.ts +3 -4
  2. package/dist/EventDispatcher.d.ts +3 -3
  3. package/dist/FileUpload.d.ts +3 -3
  4. package/dist/Slug.d.ts +3 -4
  5. package/dist/Timer.d.ts +4 -1
  6. package/dist/Validation.d.ts +2 -3
  7. package/dist/array.d.ts +113 -1
  8. package/dist/color.d.ts +9 -10
  9. package/dist/device/browser.d.ts +5 -1
  10. package/dist/device/browser.js +3 -3
  11. package/dist/device/browser.js.map +1 -1
  12. package/dist/device/camera.d.ts +7 -1
  13. package/dist/device/index.d.ts +5 -1
  14. package/dist/device/os.d.ts +6 -7
  15. package/dist/file/createDir.d.ts +5 -1
  16. package/dist/file/detectPrivateKey.d.ts +3 -4
  17. package/dist/file/detectPrivateKeyByFilePath.d.ts +2 -3
  18. package/dist/file/detectPrivateKeyByFilePath.js +5 -2
  19. package/dist/file/detectPrivateKeyByFilePath.js.map +1 -1
  20. package/dist/file/fileMove.d.ts +4 -1
  21. package/dist/file/findFilesByExt.d.ts +13 -1
  22. package/dist/file/getAllFiles.d.ts +1 -3
  23. package/dist/file/index.d.ts +4 -6
  24. package/dist/gameboi/index.d.ts +4 -6
  25. package/dist/html/transform3dToObject.d.ts +2 -4
  26. package/dist/images/downloadByUrl.d.ts +1 -3
  27. package/dist/images/index.d.ts +2 -2
  28. package/dist/images/loadImage.d.ts +1 -3
  29. package/dist/images/resize.d.ts +2 -3
  30. package/dist/images/upload.d.ts +3 -4
  31. package/dist/index.d.ts +19 -30
  32. package/dist/json.d.ts +3 -4
  33. package/dist/math/diffDate.d.ts +2 -3
  34. package/dist/math/index.d.ts +30 -3
  35. package/dist/math/positiveNumber.d.ts +2 -3
  36. package/dist/name/en.d.ts +3 -4
  37. package/dist/name/index.d.ts +12 -3
  38. package/dist/name/vi.d.ts +3 -4
  39. package/dist/object.d.ts +31 -1
  40. package/dist/permission/index.d.ts +2 -3
  41. package/dist/permission/requestCamera.d.ts +5 -1
  42. package/dist/permission/requestDeviceOrientationControl.d.ts +2 -1
  43. package/dist/response/index.d.ts +6 -7
  44. package/dist/string/convertPathnameAndQuery.d.ts +2 -4
  45. package/dist/string/formatNumber.d.ts +2 -3
  46. package/dist/string/generatePassword.d.ts +2 -3
  47. package/dist/string/generateUUID.d.ts +2 -3
  48. package/dist/string/getTextBetweenCharByIndex.d.ts +1 -3
  49. package/dist/string/index.d.ts +65 -6
  50. package/dist/string/indexesOf.d.ts +1 -3
  51. package/dist/string/makeDaySlug.d.ts +3 -4
  52. package/dist/string/random.d.ts +10 -11
  53. package/dist/string/trimNull.d.ts +2 -3
  54. package/dist/string/url.d.ts +22 -1
  55. package/dist/xconsole/enableConsole.d.ts +2 -1
  56. package/dist/xconsole/index.d.ts +11 -2
  57. package/dist/xconsole/log.d.ts +8 -9
  58. package/esm/device/browser.js +3 -3
  59. package/esm/device/browser.js.map +1 -1
  60. package/esm/file/detectPrivateKeyByFilePath.js +5 -2
  61. package/esm/file/detectPrivateKeyByFilePath.js.map +1 -1
  62. package/package.json +31 -23
  63. package/dist/Timer-7b0c4e7c.d.ts +0 -11
  64. package/dist/array-c38eff4c.d.ts +0 -158
  65. package/dist/browser-8d042ffe.d.ts +0 -22
  66. package/dist/camera-1a859d72.d.ts +0 -15
  67. package/dist/createDir-220e0081.d.ts +0 -13
  68. package/dist/enableConsole-ddc24282.d.ts +0 -11
  69. package/dist/fileMove-3a09e429.d.ts +0 -13
  70. package/dist/findFilesByExt-753e91d7.d.ts +0 -24
  71. package/dist/index-11ec3903.d.ts +0 -26
  72. package/dist/index-1f738e52.d.ts +0 -22
  73. package/dist/index-22309f0c.d.ts +0 -23
  74. package/dist/index-3eeb7834.d.ts +0 -90
  75. package/dist/index-6ae3c86b.d.ts +0 -63
  76. package/dist/object-210cae96.d.ts +0 -52
  77. package/dist/requestCamera-32b7dfc7.d.ts +0 -14
  78. package/dist/requestDeviceOrientationControl-b6458660.d.ts +0 -11
  79. package/dist/url-0da0be84.d.ts +0 -43
package/dist/Checker.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Check if the object or string is in JSON format
3
3
  */
4
- declare const isJSON: (content: object | string) => boolean;
4
+ export declare const isJSON: (content: object | string) => boolean;
5
5
  declare const Checker: {
6
6
  isJSON: (content: object | string) => boolean;
7
- };
8
-
9
- export { Checker as default, isJSON };
7
+ };
8
+ export default Checker;
@@ -8,6 +8,6 @@ declare class EventDispatcher {
8
8
  type: string;
9
9
  target: any;
10
10
  }): void;
11
- }
12
-
13
- export { EventDispatcher, EventDispatcher as default };
11
+ }
12
+ export { EventDispatcher };
13
+ export default EventDispatcher;
@@ -7,6 +7,6 @@ type UploadParams = {
7
7
  };
8
8
  declare const FileUpload: {
9
9
  uploadBlob(props: UploadParams): void;
10
- };
11
-
12
- export { FileUpload, FileUpload as default };
10
+ };
11
+ export { FileUpload };
12
+ export default FileUpload;
package/dist/Slug.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- declare const makeSlug: (s: string, opt?: {
1
+ export declare const makeSlug: (s: string, opt?: {
2
2
  [key: string]: any;
3
3
  }) => string;
4
4
  declare const slug: {
5
5
  makeSlug: (s: string, opt?: {
6
6
  [key: string]: any;
7
7
  }) => string;
8
- };
9
-
10
- export { slug as default, makeSlug };
8
+ };
9
+ export default slug;
package/dist/Timer.d.ts CHANGED
@@ -1 +1,4 @@
1
- export { a as default } from './Timer-7b0c4e7c.js';
1
+ declare const Timer: {
2
+ wait: (ms: number) => Promise<unknown>;
3
+ };
4
+ export default Timer;
@@ -1,6 +1,5 @@
1
1
  declare const Validation: {
2
2
  imageValidate(file: Blob): boolean;
3
3
  videoValidate(file: Blob): boolean;
4
- };
5
-
6
- export { Validation as default };
4
+ };
5
+ export default Validation;
package/dist/array.d.ts CHANGED
@@ -1 +1,113 @@
1
- export { i as allMatchInArray, b as averageArray, x as default, f as firstElement, o as getHalfRandom, n as getRandom, l as lastElement, c as maxArray, h as mergeAndMakeUniqueElement, m as minArray, t as moveArray, q as moveIndex, g as randomElement, r as randomIndex, j as removeItem, k as removeItemByKey, p as shuffle, e as sortElementByNumber, d as sortElementByString, s as sumArray } from './array-c38eff4c.js';
1
+ export declare const sumArray: (array: [], key: string) => number;
2
+ /**
3
+ *
4
+ * @param {Array} array
5
+ * @param {string} key
6
+ * @returns {Number}
7
+ */
8
+ export declare const averageArray: (array: [], key: string) => number;
9
+ /**
10
+ *
11
+ * @param {Array} array
12
+ * @param {string} key
13
+ * @returns {Number}
14
+ */
15
+ export declare const minArray: (array: [], key: string) => number;
16
+ /**
17
+ *
18
+ * @param {Array} array
19
+ * @param {string} key
20
+ * @returns {Number}
21
+ */
22
+ export declare const maxArray: (array: [], key: string) => number;
23
+ /**
24
+ *
25
+ * @param {Array} array
26
+ * @param {string} key
27
+ * @returns {Array}
28
+ */
29
+ export declare const sortElementByString: (array: any, key: string) => any[] | undefined;
30
+ /**
31
+ *
32
+ * @param {Array} array
33
+ * @param {string} key
34
+ * @returns {Array}
35
+ */
36
+ export declare const sortElementByNumber: (array: any, key: string) => any[] | undefined;
37
+ /**
38
+ *
39
+ * @param {Array} array
40
+ * @returns {any}
41
+ */
42
+ export declare const firstElement: (array: any[]) => any;
43
+ /**
44
+ *
45
+ * @param {Array} array
46
+ * @returns {any}
47
+ */
48
+ export declare const lastElement: (array: any[]) => any;
49
+ /**
50
+ *
51
+ * @param {Array} array
52
+ * @returns {any}
53
+ */
54
+ export declare const randomIndex: (array: any[]) => number;
55
+ /**
56
+ *
57
+ * @param {Array} array
58
+ * @returns {any}
59
+ */
60
+ export declare const randomElement: (array: any[]) => any;
61
+ /**
62
+ * Remove same elements from 2 arrays
63
+ */
64
+ export declare const mergeAndMakeUniqueElement: (list1: any[], list2: any[], key: string) => any[] | undefined;
65
+ /**
66
+ * check target == toMatch
67
+ * @param {Array} target
68
+ * @param {Array} toMatch
69
+ * @returns {Boolean}
70
+ */
71
+ export declare const allMatchInArray: (target: any[], toMatch: any[]) => boolean;
72
+ export declare const removeItem: (item: any, array: any[]) => any[];
73
+ export declare const removeItemByKey: (key: string, value: any, array: any[]) => any[];
74
+ export declare const getRandom: (array: any[], n?: number) => any[];
75
+ /**
76
+ * Get an array with shuffle element
77
+ */
78
+ export declare const getHalfRandom: (array: any[], n: number) => any[];
79
+ /**
80
+ * Make array shuffle itself
81
+ */
82
+ export declare const shuffle: (array: any[]) => any[];
83
+ /**
84
+ *
85
+ * @param {Array} array
86
+ * @param {Number} oldIndex
87
+ * @param {Number} newIndex
88
+ * @returns {Array}
89
+ */
90
+ export declare const moveIndex: (array: any[], oldIndex: number, newIndex: number) => any[];
91
+ export declare const moveArray: (array: any[], oldIndex: number, newIndex: number) => any[];
92
+ declare const xarray: {
93
+ sumArray: (array: [], key: string) => number;
94
+ averageArray: (array: [], key: string) => number;
95
+ minArray: (array: [], key: string) => number;
96
+ maxArray: (array: [], key: string) => number;
97
+ sortElementByString: (array: any, key: string) => any[] | undefined;
98
+ sortElementByNumber: (array: any, key: string) => any[] | undefined;
99
+ firstElement: (array: any[]) => any;
100
+ lastElement: (array: any[]) => any;
101
+ randomIndex: (array: any[]) => number;
102
+ randomElement: (array: any[]) => any;
103
+ mergeAndMakeUniqueElement: (list1: any[], list2: any[], key: string) => any[] | undefined;
104
+ allMatchInArray: (target: any[], toMatch: any[]) => boolean;
105
+ removeItem: (item: any, array: any[]) => any[];
106
+ removeItemByKey: (key: string, value: any, array: any[]) => any[];
107
+ getRandom: (array: any[], n?: number) => any[];
108
+ getHalfRandom: (array: any[], n: number) => any[];
109
+ shuffle: (array: any[]) => any[];
110
+ moveIndex: (array: any[], oldIndex: number, newIndex: number) => any[];
111
+ moveArray: (array: any[], oldIndex: number, newIndex: number) => any[];
112
+ };
113
+ export default xarray;
package/dist/color.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- declare const random: (hex?: boolean) => string;
2
- declare const pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
3
- declare const hexToRgb: (hex: string) => {
1
+ export declare const random: (hex?: boolean) => string;
2
+ export declare const pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
3
+ export declare const hexToRgb: (hex: string) => {
4
4
  r: number;
5
5
  g: number;
6
6
  b: number;
7
7
  } | null;
8
- declare const hexDarken: (hex: string, amount: number) => string | null;
9
- declare const hexLighten: (hex: string, amount: number) => string | null;
10
- declare const RGBToHex: (rgb: string | any) => string | null;
11
- declare const hexToVBColor: (rrggbb: string) => number;
8
+ export declare const hexDarken: (hex: string, amount: number) => string | null;
9
+ export declare const hexLighten: (hex: string, amount: number) => string | null;
10
+ export declare const RGBToHex: (rgb: string | any) => string | null;
11
+ export declare const hexToVBColor: (rrggbb: string) => number;
12
12
  declare const color: {
13
13
  random: (hex?: boolean) => string;
14
14
  pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
@@ -21,6 +21,5 @@ declare const color: {
21
21
  hexLighten: (hex: string, amount: number) => string | null;
22
22
  RGBToHex: (rgb: string | any) => string | null;
23
23
  hexToVBColor: (rrggbb: string) => number;
24
- };
25
-
26
- export { RGBToHex, color as default, hexDarken, hexLighten, hexToRgb, hexToVBColor, pSBC, random };
24
+ };
25
+ export default color;
@@ -1 +1,5 @@
1
- export { c as isFacebookWebview, d as isInAppWebview, a as isLandscape, i as isPotrait, u as ua } from '../browser-8d042ffe.js';
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;
@@ -22,9 +22,9 @@ const ua = () => {
22
22
  };
23
23
  exports.ua = ua;
24
24
  const isFacebookWebview = () => {
25
- var ua = ua();
26
- if (typeof ua != "undefined")
27
- return ua.indexOf("FBAN") > -1 || ua.indexOf("FBAV") > -1;
25
+ const _ua = (0, exports.ua)();
26
+ if (typeof _ua != "undefined")
27
+ return _ua.indexOf("FBAN") > -1 || _ua.indexOf("FBAV") > -1;
28
28
  };
29
29
  exports.isFacebookWebview = isFacebookWebview;
30
30
  const isInAppWebview = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/device/browser.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,GAAG,EAAE;IAC7B,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,KAAK,CAAC;IAE/C,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC;IACrF,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,IAAI,MAAM,CAAC,WAAW,KAAK,CAAC,EAAE,CAAC,CAAC;AACnE,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB;AAEK,MAAM,WAAW,GAAG,GAAG,EAAE;IAC/B,OAAO,CAAC,IAAA,iBAAS,GAAE,CAAC;AACrB,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEK,MAAM,EAAE,GAAG,GAAG,EAAE;IACtB,IAAI,OAAO,SAAS,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IACjD,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9C,OAAO,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,KAAK,CAAC;AACzE,CAAC,CAAC;AALW,QAAA,EAAE,MAKb;AAEK,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACrC,IAAI,EAAE,GAAQ,EAAE,EAAE,CAAC;IACnB,IAAI,OAAO,EAAE,IAAI,WAAW;QAAE,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEK,MAAM,cAAc,GAAG,GAAG,EAAE;IAClC,MAAM,KAAK,GAAG,CAAC,SAAS,EAAE,iCAAiC,EAAE,sBAAsB,CAAC,CAAC;IACrF,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvD,IAAI,IAAA,UAAE,GAAE;QAAE,OAAO,OAAO,CAAC,IAAA,UAAE,GAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/device/browser.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,GAAG,EAAE;IAC7B,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,KAAK,CAAC;IAE/C,IAAI,CAAC,MAAM,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC;IACrF,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,IAAI,MAAM,CAAC,WAAW,KAAK,CAAC,EAAE,CAAC,CAAC;AACnE,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB;AAEK,MAAM,WAAW,GAAG,GAAG,EAAE;IAC/B,OAAO,CAAC,IAAA,iBAAS,GAAE,CAAC;AACrB,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEK,MAAM,EAAE,GAAG,GAAG,EAAE;IACtB,IAAI,OAAO,SAAS,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IACjD,IAAI,OAAO,MAAM,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9C,OAAO,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,KAAK,CAAC;AACzE,CAAC,CAAC;AALW,QAAA,EAAE,MAKb;AAEK,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACrC,MAAM,GAAG,GAAQ,IAAA,UAAE,GAAE,CAAC;IACtB,IAAI,OAAO,GAAG,IAAI,WAAW;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEK,MAAM,cAAc,GAAG,GAAG,EAAE;IAClC,MAAM,KAAK,GAAG,CAAC,SAAS,EAAE,iCAAiC,EAAE,sBAAsB,CAAC,CAAC;IACrF,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvD,IAAI,IAAA,UAAE,GAAE;QAAE,OAAO,OAAO,CAAC,IAAA,UAAE,GAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
@@ -1 +1,7 @@
1
- export { g as getWebcam } from '../camera-1a859d72.js';
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 +1,5 @@
1
- export { e as checkOS, a as isAndroid, i as isIos, c as isMobile, b as isTablet } from '../index-1f738e52.js';
1
+ export declare const isIos: () => boolean | null;
2
+ export declare const isAndroid: () => boolean | null;
3
+ export declare const isTablet: () => boolean | null;
4
+ export declare const isMobile: () => boolean | null;
5
+ export declare const checkOS: () => any;
@@ -1,12 +1,11 @@
1
- declare function getOS(): "aix" | "android" | "freebsd" | "haiku" | "linux" | "openbsd" | "sunos" | "cygwin" | "netbsd" | "mac" | "win";
2
- declare function isWin(): boolean;
3
- declare function isMac(): boolean;
4
- declare function isLinux(): boolean;
1
+ export declare function getOS(): "android" | "win" | "aix" | "freebsd" | "haiku" | "linux" | "openbsd" | "sunos" | "cygwin" | "netbsd" | "mac";
2
+ export declare function isWin(): boolean;
3
+ export declare function isMac(): boolean;
4
+ export declare function isLinux(): boolean;
5
5
  declare const _default: {
6
6
  getOS: typeof getOS;
7
7
  isWin: typeof isWin;
8
8
  isMac: typeof isMac;
9
9
  isLinux: typeof isLinux;
10
- };
11
-
12
- export { _default as default, getOS, isLinux, isMac, isWin };
10
+ };
11
+ export default _default;
@@ -1 +1,5 @@
1
- export { a as createDir } from '../createDir-220e0081.js';
1
+ /**
2
+ * Create new directory
3
+ */
4
+ declare function createDir(path: string): true | undefined;
5
+ export { createDir };
@@ -1,6 +1,5 @@
1
- declare function detectPrivateKey(dirPath: string): {
1
+ export default function detectPrivateKey(dirPath: string): {
2
2
  status: boolean;
3
3
  list: string[];
4
- };
5
-
6
- export { detectPrivateKey as default, detectPrivateKey };
4
+ };
5
+ export { detectPrivateKey };
@@ -1,3 +1,2 @@
1
- declare function detectPrivateKeyByFilePath(_path: string): boolean;
2
-
3
- export { detectPrivateKeyByFilePath as default, detectPrivateKeyByFilePath };
1
+ export default function detectPrivateKeyByFilePath(_path: string): boolean;
2
+ export { detectPrivateKeyByFilePath };
@@ -5,14 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.detectPrivateKeyByFilePath = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
+ const object_1 = require("../object");
8
9
  function detectPrivateKeyByFilePath(_path) {
9
10
  //
10
11
  if (!fs_1.default.existsSync(_path))
11
12
  return true;
12
- const fileContents = fs_1.default.readFileSync(_path);
13
+ const fileContents = fs_1.default.readFileSync(_path, "utf8");
14
+ const secretPattern = /((SECRET|TOKEN|PRIVATE)[\S+|=]+[\S]+)/g;
15
+ // console.log(fileContents.match(secretPattern));
13
16
  switch (true) {
14
17
  case fileContents.includes(`${`-----`}BEGIN `):
15
- case _path.includes(".env") && fileContents.includes("SECRET=") && !fileContents.includes("SECRET=\n") && !fileContents.includes("SECRET=*"):
18
+ case _path.includes(".env") && (0, object_1.toBool)(fileContents.match(secretPattern)):
16
19
  return false;
17
20
  default:
18
21
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"detectPrivateKeyByFilePath.js","sourceRoot":"","sources":["../../src/file/detectPrivateKeyByFilePath.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEpB,SAAwB,0BAA0B,CAAC,KAAa;IAC/D,EAAE;IACF,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,MAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC5C,QAAQ,IAAI,EAAE;QACb,KAAK,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;QAC/C,KAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC3I,OAAO,KAAK,CAAC;QACd;YACC,MAAM;KACP;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAdD,6CAcC;AAEQ,gEAA0B"}
1
+ {"version":3,"file":"detectPrivateKeyByFilePath.js","sourceRoot":"","sources":["../../src/file/detectPrivateKeyByFilePath.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,sCAAmC;AAEnC,SAAwB,0BAA0B,CAAC,KAAa;IAC/D,EAAE;IACF,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,MAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAW,CAAC;IAC9D,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAE/D,kDAAkD;IAElD,QAAQ,IAAI,EAAE;QACb,KAAK,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;QAC/C,KAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAA,eAAM,EAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC;QACd;YACC,MAAM;KACP;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAlBD,6CAkBC;AAEQ,gEAA0B"}
@@ -1 +1,4 @@
1
- export { a as fileMove } from '../fileMove-3a09e429.js';
1
+ /**
2
+ * Move file to another location.
3
+ */
4
+ export declare function fileMove(oldPath: string, newPath: string, callback: any): void;
@@ -1 +1,13 @@
1
- export { a as default, c as findFileByExt, b as forEachFileByExt } from '../findFilesByExt-753e91d7.js';
1
+ /**
2
+ * This is an alias of "findFileByExt()"
3
+ */
4
+ export declare const forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
5
+ /**
6
+ * This is an alias of "forEachFileByExt()"
7
+ */
8
+ export declare const findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
9
+ declare const fileExt: {
10
+ findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
11
+ forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
12
+ };
13
+ export default fileExt;
@@ -1,3 +1 @@
1
- declare function getAllFiles(dirPath: string, skipDotStart?: true): Array<string>;
2
-
3
- export { getAllFiles as default };
1
+ export default function getAllFiles(dirPath: string, skipDotStart?: true): Array<string>;
@@ -1,11 +1,9 @@
1
- import { a as createDir } from '../createDir-220e0081.js';
2
- import { a as fileMove } from '../fileMove-3a09e429.js';
3
-
1
+ import { createDir } from "./createDir";
2
+ import { fileMove } from "./fileMove";
4
3
  declare const xfile: {
5
4
  findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
6
5
  forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
7
6
  createDir: typeof createDir;
8
7
  fileMove: typeof fileMove;
9
- };
10
-
11
- export { xfile as default };
8
+ };
9
+ export default xfile;
@@ -1,6 +1,6 @@
1
- import EventEmitter from 'events';
2
-
3
- declare class GameBoi extends EventEmitter {
1
+ /// <reference types="node" />
2
+ import EventEmitter from "events";
3
+ export default class GameBoi extends EventEmitter {
4
4
  #private;
5
5
  constructor();
6
6
  isConnected: boolean;
@@ -9,6 +9,4 @@ declare class GameBoi extends EventEmitter {
9
9
  onDisconnect(): void;
10
10
  gameLoop(): void;
11
11
  dispose(): void;
12
- }
13
-
14
- export { GameBoi as default };
12
+ }
@@ -1,7 +1,5 @@
1
- declare function transform3dToObject(element: HTMLElement): {
1
+ export default function transform3dToObject(element: HTMLElement): {
2
2
  x: any;
3
3
  y: any;
4
4
  z: any;
5
- };
6
-
7
- export { transform3dToObject as default };
5
+ };
@@ -1,3 +1 @@
1
- declare function downloadByUrl(url: string, name?: string, title?: string): Promise<unknown>;
2
-
3
- export { downloadByUrl as default };
1
+ export default function downloadByUrl(url: string, name?: string, title?: string): Promise<unknown>;
@@ -1,2 +1,2 @@
1
- export { default as upload } from './upload.js';
2
- export { default as resize } from './resize.js';
1
+ export { upload } from "./upload";
2
+ export { resize } from "./resize";
@@ -1,3 +1 @@
1
- declare function loadImage(list: Array<string>): Promise<unknown[] | undefined>;
2
-
3
- export { loadImage as default };
1
+ export default function loadImage(list: Array<string>): Promise<unknown[] | undefined>;
@@ -1,3 +1,2 @@
1
- declare const resize: (file: File) => Promise<{} | undefined>;
2
-
3
- export { resize as default, resize };
1
+ export declare const resize: (file: File) => Promise<{} | undefined>;
2
+ export default resize;
@@ -1,4 +1,4 @@
1
- declare const upload: (file: File) => Promise<{
1
+ export declare const upload: (file: File) => Promise<{
2
2
  status: number;
3
3
  error: boolean;
4
4
  messages: any[];
@@ -6,6 +6,5 @@ declare const upload: (file: File) => Promise<{
6
6
  } | {
7
7
  blob: any;
8
8
  url: string;
9
- }>;
10
-
11
- export { upload as default, upload };
9
+ }>;
10
+ export default upload;
package/dist/index.d.ts CHANGED
@@ -1,30 +1,20 @@
1
- import { a as array } from './array-c38eff4c.js';
2
- import { d as device } from './index-1f738e52.js';
3
- import { c as console } from './index-11ec3903.js';
4
- import { b as browser } from './browser-8d042ffe.js';
5
- import { c as camera } from './camera-1a859d72.js';
6
- import { m as math } from './index-6ae3c86b.js';
7
- import { x as xname } from './index-22309f0c.js';
8
- import { o as object } from './object-210cae96.js';
9
- import { s as string } from './index-3eeb7834.js';
10
- import { u as url } from './url-0da0be84.js';
11
- import { c as createDir } from './createDir-220e0081.js';
12
- import { f as fileMove } from './fileMove-3a09e429.js';
13
- import { f as findFilesByExt } from './findFilesByExt-753e91d7.js';
14
- import { T as Timer } from './Timer-7b0c4e7c.js';
15
- import { r as requestCamera } from './requestCamera-32b7dfc7.js';
16
- import { r as requestDeviceOrientationControl } from './requestDeviceOrientationControl-b6458660.js';
17
- import { e as enableConsole } from './enableConsole-ddc24282.js';
18
- import './math/diffDate.js';
19
- import './math/positiveNumber.js';
20
- import './name/en.js';
21
- import './name/vi.js';
22
- import './string/makeDaySlug.js';
23
- import './string/generateUUID.js';
24
- import './string/formatNumber.js';
25
- import './string/generatePassword.js';
26
- import './string/trimNull.js';
27
-
1
+ import * as array from "./array";
2
+ import * as device from "./device";
3
+ import * as console from "./xconsole";
4
+ import * as browser from "./device/browser";
5
+ import * as camera from "./device/camera";
6
+ import * as math from "./math";
7
+ import * as xname from "./name";
8
+ import * as object from "./object";
9
+ import * as string from "./string";
10
+ import * as url from "./string/url";
11
+ import * as createDir from "./file/createDir";
12
+ import * as fileMove from "./file/fileMove";
13
+ import * as findFilesByExt from "./file/findFilesByExt";
14
+ import * as Timer from "./Timer";
15
+ import * as requestCamera from "./permission/requestCamera";
16
+ import * as requestDeviceOrientationControl from "./permission/requestDeviceOrientationControl";
17
+ import * as enableConsole from "./xconsole/enableConsole";
28
18
  declare const utils: {
29
19
  xname: typeof xname;
30
20
  array: typeof array;
@@ -43,6 +33,5 @@ declare const utils: {
43
33
  requestCamera: typeof requestCamera;
44
34
  requestDeviceOrientationControl: typeof requestDeviceOrientationControl;
45
35
  enableConsole: typeof enableConsole;
46
- };
47
-
48
- export { utils as default };
36
+ };
37
+ export default utils;
package/dist/json.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Check if the object or string is in JSON format
3
3
  */
4
- declare const isValid: (content: object | string) => boolean;
4
+ export declare const isValid: (content: object | string) => boolean;
5
5
  declare const xjson: {
6
6
  isValid: (content: object | string) => boolean;
7
- };
8
-
9
- export { xjson as default, isValid };
7
+ };
8
+ export default xjson;
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Returns amount of different days between 2 dates
3
3
  */
4
- declare function diffDate(date1: string, date2: string): number;
5
-
6
- export { diffDate as default, diffDate };
4
+ export declare function diffDate(date1: string, date2: string): number;
5
+ export default diffDate;
@@ -1,3 +1,30 @@
1
- import './diffDate.js';
2
- import './positiveNumber.js';
3
- export { j as angleBetweenPoints, g as clamp, x as default, i as degBetweenPoints, h as degBetweenPoints360, e as degToRad, k as distance2Point, f as radToDeg, a as rand, d as randFloat, b as randHalt, c as randInt, r as randRound } from '../index-6ae3c86b.js';
1
+ export declare const randRound: (number: number) => number;
2
+ export declare const rand: (number: number) => number;
3
+ export declare const randHalt: (number: number) => number;
4
+ export declare const randInt: (low: number, high: number) => number;
5
+ export declare const randFloat: (low: number, high: number) => number;
6
+ export declare const degToRad: (degrees: number) => number;
7
+ export declare const radToDeg: (radians: number) => number;
8
+ export declare const clamp: (value: number, min: number, max: number) => number;
9
+ export declare const degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
10
+ export declare const degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
11
+ export declare const angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
12
+ export declare const distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
13
+ import { diffDate } from "./diffDate";
14
+ import { positiveNumber } from "./positiveNumber";
15
+ declare const xmath: {
16
+ rand: (number: number) => number;
17
+ randRound: (number: number) => number;
18
+ randHalt: (number: number) => number;
19
+ randInt: (low: number, high: number) => number;
20
+ randFloat: (low: number, high: number) => number;
21
+ degToRad: (degrees: number) => number;
22
+ radToDeg: (radians: number) => number;
23
+ degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
24
+ degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
25
+ angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
26
+ distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
27
+ diffDate: typeof diffDate;
28
+ positiveNumber: typeof positiveNumber;
29
+ };
30
+ export default xmath;
@@ -1,3 +1,2 @@
1
- declare function positiveNumber(number: number): number;
2
-
3
- export { positiveNumber as default, positiveNumber };
1
+ export declare function positiveNumber(number: number): number;
2
+ export default positiveNumber;
package/dist/name/en.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- declare function generateName(): string;
1
+ export declare function generateName(): string;
2
2
  declare const NameEN: {
3
3
  generateName: typeof generateName;
4
- };
5
-
6
- export { NameEN as default, generateName };
4
+ };
5
+ export default NameEN;
@@ -1,3 +1,12 @@
1
- export { default as NameEN } from './en.js';
2
- export { default as NameVI } from './vi.js';
3
- export { a as default } from '../index-22309f0c.js';
1
+ import NameEN from "./en";
2
+ import NameVI from "./vi";
3
+ export { NameEN, NameVI };
4
+ declare const xname: {
5
+ NameEN: {
6
+ generateName: typeof import("./en").generateName;
7
+ };
8
+ NameVI: {
9
+ generateName: (useGender?: boolean, male?: boolean) => any;
10
+ };
11
+ };
12
+ export default xname;
package/dist/name/vi.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- declare const generateName: (useGender?: boolean, male?: boolean) => any;
1
+ export declare const generateName: (useGender?: boolean, male?: boolean) => any;
2
2
  declare const NameVI: {
3
3
  generateName: (useGender?: boolean, male?: boolean) => any;
4
- };
5
-
6
- export { NameVI as default, generateName };
4
+ };
5
+ export default NameVI;