diginext-utils 3.0.5 → 3.0.6
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.
- package/dist/Checker.d.ts +3 -4
- package/dist/EventDispatcher.d.ts +3 -3
- package/dist/FileUpload.d.ts +3 -3
- package/dist/Slug.d.ts +3 -4
- package/dist/Timer.d.ts +4 -1
- package/dist/Validation.d.ts +2 -3
- package/dist/array.d.ts +113 -1
- package/dist/color.d.ts +9 -10
- package/dist/device/browser.d.ts +5 -1
- package/dist/device/camera.d.ts +7 -1
- package/dist/device/index.d.ts +5 -1
- package/dist/device/os.d.ts +6 -7
- package/dist/file/createDir.d.ts +5 -1
- package/dist/file/detectPrivateKey.d.ts +3 -4
- package/dist/file/detectPrivateKeyByFilePath.d.ts +2 -3
- package/dist/file/detectPrivateKeyByFilePath.js +5 -2
- package/dist/file/detectPrivateKeyByFilePath.js.map +1 -1
- package/dist/file/fileMove.d.ts +4 -1
- package/dist/file/findFilesByExt.d.ts +13 -1
- package/dist/file/getAllFiles.d.ts +1 -3
- package/dist/file/index.d.ts +4 -6
- package/dist/gameboi/index.d.ts +4 -6
- package/dist/html/transform3dToObject.d.ts +2 -4
- package/dist/images/downloadByUrl.d.ts +1 -3
- package/dist/images/index.d.ts +2 -2
- package/dist/images/loadImage.d.ts +1 -3
- package/dist/images/resize.d.ts +2 -3
- package/dist/images/upload.d.ts +3 -4
- package/dist/index.d.ts +19 -30
- package/dist/json.d.ts +3 -4
- package/dist/math/diffDate.d.ts +2 -3
- package/dist/math/index.d.ts +30 -3
- package/dist/math/positiveNumber.d.ts +2 -3
- package/dist/name/en.d.ts +3 -4
- package/dist/name/index.d.ts +12 -3
- package/dist/name/vi.d.ts +3 -4
- package/dist/object.d.ts +31 -1
- package/dist/permission/index.d.ts +2 -3
- package/dist/permission/requestCamera.d.ts +5 -1
- package/dist/permission/requestDeviceOrientationControl.d.ts +2 -1
- package/dist/response/index.d.ts +6 -7
- package/dist/string/convertPathnameAndQuery.d.ts +2 -4
- package/dist/string/formatNumber.d.ts +2 -3
- package/dist/string/generatePassword.d.ts +2 -3
- package/dist/string/generateUUID.d.ts +2 -3
- package/dist/string/getTextBetweenCharByIndex.d.ts +1 -3
- package/dist/string/index.d.ts +65 -6
- package/dist/string/indexesOf.d.ts +1 -3
- package/dist/string/makeDaySlug.d.ts +3 -4
- package/dist/string/random.d.ts +10 -11
- package/dist/string/trimNull.d.ts +2 -3
- package/dist/string/url.d.ts +22 -1
- package/dist/xconsole/enableConsole.d.ts +2 -1
- package/dist/xconsole/index.d.ts +11 -2
- package/dist/xconsole/log.d.ts +8 -9
- package/esm/file/detectPrivateKeyByFilePath.js +5 -2
- package/esm/file/detectPrivateKeyByFilePath.js.map +1 -1
- package/package.json +31 -23
- package/dist/Timer-7b0c4e7c.d.ts +0 -11
- package/dist/array-c38eff4c.d.ts +0 -158
- package/dist/browser-8d042ffe.d.ts +0 -22
- package/dist/camera-1a859d72.d.ts +0 -15
- package/dist/createDir-220e0081.d.ts +0 -13
- package/dist/enableConsole-ddc24282.d.ts +0 -11
- package/dist/fileMove-3a09e429.d.ts +0 -13
- package/dist/findFilesByExt-753e91d7.d.ts +0 -24
- package/dist/index-11ec3903.d.ts +0 -26
- package/dist/index-1f738e52.d.ts +0 -22
- package/dist/index-22309f0c.d.ts +0 -23
- package/dist/index-3eeb7834.d.ts +0 -90
- package/dist/index-6ae3c86b.d.ts +0 -63
- package/dist/object-210cae96.d.ts +0 -52
- package/dist/requestCamera-32b7dfc7.d.ts +0 -14
- package/dist/requestDeviceOrientationControl-b6458660.d.ts +0 -11
- 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;
|
package/dist/FileUpload.d.ts
CHANGED
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
package/dist/Validation.d.ts
CHANGED
package/dist/array.d.ts
CHANGED
|
@@ -1 +1,113 @@
|
|
|
1
|
-
export
|
|
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;
|
package/dist/device/browser.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
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;
|
package/dist/device/camera.d.ts
CHANGED
package/dist/device/index.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
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;
|
package/dist/device/os.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
declare function getOS(): "
|
|
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;
|
package/dist/file/createDir.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
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") &&
|
|
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;
|
|
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"}
|
package/dist/file/fileMove.d.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
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;
|
package/dist/file/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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;
|
package/dist/gameboi/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
}
|
package/dist/images/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { upload } from "./upload";
|
|
2
|
+
export { resize } from "./resize";
|
package/dist/images/resize.d.ts
CHANGED
|
@@ -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;
|
package/dist/images/upload.d.ts
CHANGED
|
@@ -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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
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;
|
package/dist/math/diffDate.d.ts
CHANGED
|
@@ -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;
|
package/dist/math/index.d.ts
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
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
package/dist/name/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
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;
|
package/dist/object.d.ts
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const isNull: (object: any) => boolean;
|
|
2
|
+
export declare const toBool: (object: any) => boolean;
|
|
3
|
+
export declare const toInt: (object: any) => number;
|
|
4
|
+
export declare const toFloat: (object: any) => number;
|
|
5
|
+
export declare const toArray: (object: any) => any;
|
|
6
|
+
/**
|
|
7
|
+
* Convert value in object to array
|
|
8
|
+
*/
|
|
9
|
+
export declare const objectToArray: (object: any) => any[];
|
|
10
|
+
/**
|
|
11
|
+
* Iterate through every keys & values of the object
|
|
12
|
+
*/
|
|
13
|
+
export declare const iterate: (obj: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}, callbackFn: (obj: any, key?: string, value?: any) => any) => {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
declare const xobject: {
|
|
19
|
+
isNull: (object: any) => boolean;
|
|
20
|
+
toBool: (object: any) => boolean;
|
|
21
|
+
toInt: (object: any) => number;
|
|
22
|
+
toFloat: (object: any) => number;
|
|
23
|
+
toArray: (object: any) => any;
|
|
24
|
+
objectToArray: (object: any) => any[];
|
|
25
|
+
iterate: (obj: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}, callbackFn: (obj: any, key?: string, value?: any) => any) => {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default xobject;
|