diginext-utils 2.1.18 → 2.1.20
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 +8 -8
- package/dist/Checker.js +31 -31
- package/dist/EventDispatcher.d.ts +13 -13
- package/dist/EventDispatcher.js +51 -51
- package/dist/FileUpload.d.ts +12 -12
- package/dist/FileUpload.js +64 -64
- package/dist/Slug.d.ts +9 -9
- package/dist/Slug.js +333 -333
- package/dist/Timer.d.ts +4 -4
- package/dist/Timer.js +8 -8
- package/dist/Validation.d.ts +5 -5
- package/dist/Validation.js +38 -38
- package/dist/array.d.ts +113 -113
- package/dist/array.js +297 -297
- package/dist/color.d.ts +25 -25
- package/dist/color.js +95 -95
- package/dist/console/enableConsole.d.ts +2 -2
- package/dist/console/enableConsole.js +13 -13
- package/dist/console/index.d.ts +11 -11
- package/dist/console/index.js +17 -17
- package/dist/console/log.d.ts +15 -15
- package/dist/console/log.js +44 -44
- package/dist/device/browser.d.ts +5 -5
- package/dist/device/browser.js +37 -37
- package/dist/device/camera.d.ts +7 -7
- package/dist/device/camera.js +171 -171
- package/dist/device/index.d.ts +5 -5
- package/dist/device/index.js +224 -224
- package/dist/device/os.d.ts +11 -11
- package/dist/device/os.js +37 -37
- package/dist/file/createDir.d.ts +5 -5
- package/dist/file/createDir.js +15 -15
- package/dist/file/fileMove.d.ts +4 -4
- package/dist/file/fileMove.js +32 -32
- package/dist/file/findFilesByExt.d.ts +13 -13
- package/dist/file/findFilesByExt.js +49 -49
- package/dist/file/index.d.ts +9 -9
- package/dist/file/index.js +10 -10
- package/dist/gameboi/index.d.ts +10 -10
- package/dist/gameboi/index.js +64 -67
- package/dist/gameboi/index.js.map +1 -1
- package/dist/images/downloadByUrl.d.ts +1 -1
- package/dist/images/downloadByUrl.js +55 -55
- package/dist/images/index.d.ts +2 -2
- package/dist/images/index.js +8 -8
- package/dist/images/loadImage.d.ts +1 -1
- package/dist/images/loadImage.js +17 -17
- package/dist/images/resize.d.ts +2 -2
- package/dist/images/resize.js +37 -37
- package/dist/images/upload.d.ts +10 -10
- package/dist/images/upload.js +26 -26
- package/dist/index.d.ts +37 -37
- package/dist/index.js +62 -62
- package/dist/json.d.ts +8 -8
- package/dist/json.js +31 -31
- package/dist/math/diffDate.d.ts +5 -5
- package/dist/math/diffDate.js +13 -13
- package/dist/math/index.d.ts +30 -30
- package/dist/math/index.js +92 -92
- package/dist/math/positiveNumber.d.ts +2 -2
- package/dist/math/positiveNumber.js +16 -16
- package/dist/name/en.d.ts +5 -5
- package/dist/name/en.js +25 -25
- package/dist/name/index.d.ts +12 -12
- package/dist/name/index.js +12 -12
- package/dist/name/vi.d.ts +5 -5
- package/dist/name/vi.js +27 -27
- package/dist/object.d.ts +59 -59
- package/dist/object.js +79 -79
- package/dist/permission/index.d.ts +8 -8
- package/dist/permission/index.js +6 -6
- package/dist/permission/requestCamera.d.ts +5 -5
- package/dist/permission/requestCamera.js +42 -42
- package/dist/permission/requestDeviceOrientationControl.d.ts +2 -2
- package/dist/permission/requestDeviceOrientationControl.js +38 -38
- package/dist/response/index.d.ts +49 -49
- package/dist/response/index.js +51 -51
- package/dist/string/convertPathnameAndQuery.d.ts +4 -4
- package/dist/string/convertPathnameAndQuery.js +24 -24
- package/dist/string/formatNumber.d.ts +6 -6
- package/dist/string/formatNumber.js +14 -14
- package/dist/string/generatePassword.d.ts +9 -9
- package/dist/string/generatePassword.js +23 -23
- package/dist/string/generateUUID.d.ts +2 -2
- package/dist/string/generateUUID.js +36 -36
- package/dist/string/getTextBetweenCharByIndex.d.ts +1 -1
- package/dist/string/getTextBetweenCharByIndex.js +20 -20
- package/dist/string/index.d.ts +65 -65
- package/dist/string/index.js +161 -161
- package/dist/string/indexesOf.d.ts +1 -1
- package/dist/string/indexesOf.js +14 -14
- package/dist/string/makeDaySlug.d.ts +31 -31
- package/dist/string/makeDaySlug.js +22 -22
- package/dist/string/random.d.ts +18 -18
- package/dist/string/random.js +40 -40
- package/dist/string/trimNull.d.ts +2 -2
- package/dist/string/trimNull.js +20 -20
- package/dist/string/url.d.ts +22 -22
- package/dist/string/url.js +74 -74
- package/esm/Checker.d.ts +8 -8
- package/esm/Checker.js +27 -27
- package/esm/EventDispatcher.d.ts +13 -13
- package/esm/EventDispatcher.js +48 -48
- package/esm/FileUpload.d.ts +12 -12
- package/esm/FileUpload.js +61 -61
- package/esm/Slug.d.ts +9 -9
- package/esm/Slug.js +329 -329
- package/esm/Timer.d.ts +4 -4
- package/esm/Timer.js +6 -6
- package/esm/Validation.d.ts +5 -5
- package/esm/Validation.js +36 -36
- package/esm/array.d.ts +113 -113
- package/esm/array.js +275 -275
- package/esm/color.d.ts +25 -25
- package/esm/color.js +85 -85
- package/esm/console/enableConsole.d.ts +2 -2
- package/esm/console/enableConsole.js +6 -6
- package/esm/console/index.d.ts +11 -11
- package/esm/console/index.js +12 -12
- package/esm/console/log.d.ts +15 -15
- package/esm/console/log.js +32 -32
- package/esm/device/browser.d.ts +5 -5
- package/esm/device/browser.js +29 -29
- package/esm/device/camera.d.ts +7 -7
- package/esm/device/camera.js +167 -167
- package/esm/device/index.d.ts +5 -5
- package/esm/device/index.js +216 -216
- package/esm/device/os.d.ts +11 -11
- package/esm/device/os.js +27 -27
- package/esm/file/createDir.d.ts +5 -5
- package/esm/file/createDir.js +12 -12
- package/esm/file/fileMove.d.ts +4 -4
- package/esm/file/fileMove.js +28 -28
- package/esm/file/findFilesByExt.d.ts +13 -13
- package/esm/file/findFilesByExt.js +45 -45
- package/esm/file/index.d.ts +9 -9
- package/esm/file/index.js +5 -5
- package/esm/gameboi/index.d.ts +10 -10
- package/esm/gameboi/index.js +61 -61
- package/esm/gameboi/index.js.map +1 -1
- package/esm/images/downloadByUrl.d.ts +1 -1
- package/esm/images/downloadByUrl.js +52 -52
- package/esm/images/index.d.ts +2 -2
- package/esm/images/index.js +3 -3
- package/esm/images/loadImage.d.ts +1 -1
- package/esm/images/loadImage.js +14 -14
- package/esm/images/resize.d.ts +2 -2
- package/esm/images/resize.js +30 -30
- package/esm/images/upload.d.ts +10 -10
- package/esm/images/upload.js +19 -19
- package/esm/index.d.ts +37 -37
- package/esm/index.js +37 -37
- package/esm/json.d.ts +8 -8
- package/esm/json.js +27 -27
- package/esm/math/diffDate.d.ts +5 -5
- package/esm/math/diffDate.js +9 -9
- package/esm/math/index.d.ts +30 -30
- package/esm/math/index.js +77 -77
- package/esm/math/positiveNumber.d.ts +2 -2
- package/esm/math/positiveNumber.js +12 -12
- package/esm/name/en.d.ts +5 -5
- package/esm/name/en.js +21 -21
- package/esm/name/index.d.ts +12 -12
- package/esm/name/index.js +5 -5
- package/esm/name/vi.d.ts +5 -5
- package/esm/name/vi.js +23 -23
- package/esm/object.d.ts +59 -59
- package/esm/object.js +69 -69
- package/esm/permission/index.d.ts +8 -8
- package/esm/permission/index.js +4 -4
- package/esm/permission/requestCamera.d.ts +5 -5
- package/esm/permission/requestCamera.js +38 -38
- package/esm/permission/requestDeviceOrientationControl.d.ts +2 -2
- package/esm/permission/requestDeviceOrientationControl.js +34 -34
- package/esm/response/index.d.ts +49 -49
- package/esm/response/index.js +45 -45
- package/esm/string/convertPathnameAndQuery.d.ts +4 -4
- package/esm/string/convertPathnameAndQuery.js +21 -21
- package/esm/string/formatNumber.d.ts +6 -6
- package/esm/string/formatNumber.js +10 -10
- package/esm/string/generatePassword.d.ts +9 -9
- package/esm/string/generatePassword.js +19 -19
- package/esm/string/generateUUID.d.ts +2 -2
- package/esm/string/generateUUID.js +32 -32
- package/esm/string/getTextBetweenCharByIndex.d.ts +1 -1
- package/esm/string/getTextBetweenCharByIndex.js +14 -14
- package/esm/string/index.d.ts +65 -65
- package/esm/string/index.js +150 -150
- package/esm/string/indexesOf.d.ts +1 -1
- package/esm/string/indexesOf.js +11 -11
- package/esm/string/makeDaySlug.d.ts +31 -31
- package/esm/string/makeDaySlug.js +15 -15
- package/esm/string/random.d.ts +18 -18
- package/esm/string/random.js +33 -33
- package/esm/string/trimNull.d.ts +2 -2
- package/esm/string/trimNull.js +13 -13
- package/esm/string/url.d.ts +22 -22
- package/esm/string/url.js +64 -64
- package/package.json +4 -4
|
@@ -1,43 +1,43 @@
|
|
|
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;
|
|
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
43
|
//# sourceMappingURL=requestCamera.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const requestDeviceOrientationControl: () => false | Promise<unknown>;
|
|
2
|
-
export default requestDeviceOrientationControl;
|
|
1
|
+
export declare const requestDeviceOrientationControl: () => false | Promise<unknown>;
|
|
2
|
+
export default requestDeviceOrientationControl;
|
|
@@ -1,39 +1,39 @@
|
|
|
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;
|
|
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
39
|
//# sourceMappingURL=requestDeviceOrientationControl.js.map
|
package/dist/response/index.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
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
|
+
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;
|
package/dist/response/index.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
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;
|
|
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
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function convertPathnameAndQuery(url: string): {
|
|
2
|
-
pathname: string;
|
|
3
|
-
query: any;
|
|
4
|
-
} | null;
|
|
1
|
+
export default function convertPathnameAndQuery(url: string): {
|
|
2
|
+
pathname: string;
|
|
3
|
+
query: any;
|
|
4
|
+
} | null;
|
|
@@ -1,25 +1,25 @@
|
|
|
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;
|
|
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
25
|
//# sourceMappingURL=convertPathnameAndQuery.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
+
/**
|
|
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 +1,15 @@
|
|
|
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;
|
|
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
15
|
//# sourceMappingURL=formatNumber.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
+
/**
|
|
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 +1,24 @@
|
|
|
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;
|
|
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
24
|
//# sourceMappingURL=generatePassword.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function generateUUID(): string;
|
|
2
|
-
export default generateUUID;
|
|
1
|
+
export declare function generateUUID(): string;
|
|
2
|
+
export default generateUUID;
|
|
@@ -1,37 +1,37 @@
|
|
|
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;
|
|
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
37
|
//# sourceMappingURL=generateUUID.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getTextBetweenCharByIndex(str: string, char: any, index: Number): string;
|
|
1
|
+
export default function getTextBetweenCharByIndex(str: string, char: any, index: Number): string;
|