diginext-utils 2.0.5 → 2.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/console/enableConsole.js +12 -34
- package/dist/console/index.js +7 -30
- package/dist/device/browser.js +9 -34
- package/dist/device/camera.js +4 -33
- package/dist/{chunk-QXFH3X2K.mjs → esm/chunk-5HIQS7HE.js} +1 -10
- package/dist/{chunk-AKU6F3WT.mjs → esm/chunk-EZUCZHGV.js} +1 -3
- package/dist/{chunk-A4YWYLCH.mjs → esm/chunk-HDM7KM5F.js} +1 -4
- package/dist/{chunk-FTE6FZSH.mjs → esm/chunk-LNLCKCWC.js} +1 -8
- package/dist/{chunk-2R5DRG2S.mjs → esm/chunk-X3K4KC75.js} +1 -3
- package/dist/esm/console/enableConsole.js +9 -0
- package/dist/{chunk-LXQIKFED.mjs → esm/console/index.js} +3 -5
- package/dist/{chunk-FOWYH6LL.mjs → esm/device/browser.js} +3 -7
- package/dist/{chunk-3NMJTC44.mjs → esm/device/camera.js} +3 -12
- package/dist/{file/createDir.mjs → esm/file/createDir.js} +3 -6
- package/dist/{file/fileMove.mjs → esm/file/fileMove.js} +3 -6
- package/dist/{file/findFilesByExt.mjs → esm/file/findFilesByExt.js} +3 -6
- package/dist/{math/diffDate.mjs → esm/math/diffDate.js} +3 -4
- package/dist/esm/math/index.js +2 -0
- package/dist/{math/positiveNumber.mjs → esm/math/positiveNumber.js} +4 -7
- package/dist/{name/en.mjs → esm/name/en.js} +3 -4
- package/dist/{name/vi.mjs → esm/name/vi.js} +4 -7
- package/dist/esm/permission/requestCamera.js +2 -0
- package/dist/{permission/requestDeviceOrientationControl.mjs → esm/permission/requestDeviceOrientationControl.js} +3 -4
- package/dist/{string/formatNumber.mjs → esm/string/formatNumber.js} +4 -7
- package/dist/{string/generatePassword.mjs → esm/string/generatePassword.js} +4 -10
- package/dist/{string/generateUUID.mjs → esm/string/generateUUID.js} +3 -4
- package/dist/{chunk-7UXN7I4K.mjs → esm/string/index.js} +3 -13
- package/dist/esm/string/random.js +2 -0
- package/dist/{string/trimNull.mjs → esm/string/trimNull.js} +4 -6
- package/dist/{string/url.mjs → esm/string/url.js} +4 -14
- package/dist/file/createDir.js +14 -27
- package/dist/file/fileMove.js +14 -27
- package/dist/file/findFilesByExt.js +15 -28
- package/dist/math/diffDate.js +5 -26
- package/dist/math/index.js +12 -40
- package/dist/math/positiveNumber.js +4 -27
- package/dist/name/en.js +5 -26
- package/dist/name/vi.js +4 -29
- package/dist/permission/requestCamera.js +5 -26
- package/dist/permission/requestDeviceOrientationControl.js +4 -27
- package/dist/string/formatNumber.js +4 -27
- package/dist/string/generatePassword.js +4 -27
- package/dist/string/generateUUID.js +5 -26
- package/dist/string/index.js +11 -41
- package/dist/string/random.js +10 -36
- package/dist/string/trimNull.js +12 -34
- package/dist/string/url.js +10 -40
- package/package.json +3 -4
- package/dist/.DS_Store +0 -0
- package/dist/Checker.d.ts +0 -6
- package/dist/Checker.js +0 -48
- package/dist/Checker.mjs +0 -26
- package/dist/EventDispatcher.d.ts +0 -13
- package/dist/EventDispatcher.js +0 -74
- package/dist/EventDispatcher.mjs +0 -52
- package/dist/FileUpload.d.ts +0 -12
- package/dist/FileUpload.js +0 -82
- package/dist/FileUpload.mjs +0 -60
- package/dist/Slug.d.ts +0 -5
- package/dist/Slug.js +0 -350
- package/dist/Slug.mjs +0 -328
- package/dist/Timer.d.ts +0 -5
- package/dist/Timer.js +0 -33
- package/dist/Timer.mjs +0 -7
- package/dist/Validation.d.ts +0 -6
- package/dist/Validation.js +0 -56
- package/dist/Validation.mjs +0 -34
- package/dist/array.d.ts +0 -93
- package/dist/array.js +0 -253
- package/dist/array.mjs +0 -44
- package/dist/chunk-5AL36RZR.mjs +0 -54
- package/dist/chunk-AHFJBIQJ.mjs +0 -10
- package/dist/chunk-ALNAD4H7.mjs +0 -10
- package/dist/chunk-NLQXFCPR.mjs +0 -30
- package/dist/chunk-R2BH5I6O.mjs +0 -9
- package/dist/chunk-S2U7F2JJ.mjs +0 -207
- package/dist/chunk-UKRVCU5M.mjs +0 -171
- package/dist/color.d.ts +0 -12
- package/dist/color.js +0 -95
- package/dist/color.mjs +0 -68
- package/dist/console/enableConsole.mjs +0 -11
- package/dist/console/index.mjs +0 -18
- package/dist/device/browser.mjs +0 -39
- package/dist/device/camera.mjs +0 -146
- package/dist/device.d.ts +0 -6
- package/dist/device.js +0 -197
- package/dist/device.mjs +0 -13
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -906
- package/dist/index.mjs +0 -143
- package/dist/math/index.mjs +0 -21
- package/dist/object.d.ts +0 -25
- package/dist/object.js +0 -82
- package/dist/object.mjs +0 -17
- package/dist/permission/requestCamera.mjs +0 -7
- package/dist/string/index.mjs +0 -96
- package/dist/string/random.mjs +0 -17
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
-
mod
|
|
22
|
-
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cloneDeep = require('lodash/cloneDeep');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
|
|
24
10
|
|
|
25
11
|
// src/console/enableConsole.ts
|
|
26
|
-
var
|
|
27
|
-
__export(enableConsole_exports, {
|
|
28
|
-
enableConsole: () => enableConsole
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(enableConsole_exports);
|
|
31
|
-
var import_cloneDeep = __toESM(require("lodash/cloneDeep"));
|
|
32
|
-
var _console = (0, import_cloneDeep.default)(console);
|
|
12
|
+
var _console = cloneDeep__default["default"](console);
|
|
33
13
|
function enableConsole() {
|
|
34
14
|
return _console;
|
|
35
15
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
enableConsole
|
|
39
|
-
});
|
|
16
|
+
|
|
17
|
+
exports.enableConsole = enableConsole;
|
package/dist/console/index.js
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
18
4
|
|
|
19
5
|
// src/console/index.ts
|
|
20
|
-
var console_exports = {};
|
|
21
|
-
__export(console_exports, {
|
|
22
|
-
disableConsole: () => disableConsole,
|
|
23
|
-
removeConsole: () => removeConsole,
|
|
24
|
-
showCredit: () => showCredit
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(console_exports);
|
|
27
6
|
var disableConsole = (params) => {
|
|
28
7
|
for (var key in console) {
|
|
29
8
|
console[key] = function() {
|
|
@@ -34,9 +13,7 @@ var removeConsole = disableConsole;
|
|
|
34
13
|
var showCredit = (params) => {
|
|
35
14
|
console.log("Developed by Digitop | https://www.wearetopgroup.com/?utm_src=console");
|
|
36
15
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
showCredit
|
|
42
|
-
});
|
|
16
|
+
|
|
17
|
+
exports.disableConsole = disableConsole;
|
|
18
|
+
exports.removeConsole = removeConsole;
|
|
19
|
+
exports.showCredit = showCredit;
|
package/dist/device/browser.js
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
18
4
|
|
|
19
5
|
// src/device/browser.ts
|
|
20
|
-
var browser_exports = {};
|
|
21
|
-
__export(browser_exports, {
|
|
22
|
-
isFacebookWebview: () => isFacebookWebview,
|
|
23
|
-
isInAppWebview: () => isInAppWebview,
|
|
24
|
-
isLandscape: () => isLandscape,
|
|
25
|
-
isPotrait: () => isPotrait,
|
|
26
|
-
ua: () => ua
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(browser_exports);
|
|
29
6
|
var isPotrait = () => {
|
|
30
7
|
if (typeof window == "undefined")
|
|
31
8
|
return false;
|
|
@@ -55,11 +32,9 @@ var isInAppWebview = () => {
|
|
|
55
32
|
return Boolean(ua().match(regex));
|
|
56
33
|
return false;
|
|
57
34
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
ua
|
|
65
|
-
});
|
|
35
|
+
|
|
36
|
+
exports.isFacebookWebview = isFacebookWebview;
|
|
37
|
+
exports.isInAppWebview = isInAppWebview;
|
|
38
|
+
exports.isLandscape = isLandscape;
|
|
39
|
+
exports.isPotrait = isPotrait;
|
|
40
|
+
exports.ua = ua;
|
package/dist/device/camera.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
var camera_exports = {};
|
|
21
|
-
__export(camera_exports, {
|
|
22
|
-
getWebcam: () => getWebcam
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(camera_exports);
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
25
4
|
|
|
26
5
|
// src/permission/requestCamera.ts
|
|
27
6
|
var requestCamera = ({ audio = true, video = true }) => {
|
|
@@ -73,8 +52,6 @@ function getWebcam({
|
|
|
73
52
|
},
|
|
74
53
|
audio
|
|
75
54
|
};
|
|
76
|
-
let stream;
|
|
77
|
-
let isAllowed = false;
|
|
78
55
|
console.log("[Camera.js] Requesting:", requestedMediaConstraints);
|
|
79
56
|
const res = await requestCamera({ audio });
|
|
80
57
|
if (!res) {
|
|
@@ -132,11 +109,9 @@ function getWebcam({
|
|
|
132
109
|
navigator.mediaDevices.enumerateDevices().then(parseDevices).catch(handleError);
|
|
133
110
|
return;
|
|
134
111
|
}
|
|
135
|
-
isAllowed = true;
|
|
136
112
|
playWebcamVideo(stream2);
|
|
137
113
|
}
|
|
138
114
|
function playWebcamVideo(_stream) {
|
|
139
|
-
stream = _stream;
|
|
140
115
|
if ("srcObject" in video) {
|
|
141
116
|
video.srcObject = _stream;
|
|
142
117
|
} else {
|
|
@@ -155,7 +130,6 @@ function getWebcam({
|
|
|
155
130
|
});
|
|
156
131
|
video.addEventListener("error", (e) => console.log("[Camera.js] <video> error:", e));
|
|
157
132
|
video.addEventListener("stalled", function(e) {
|
|
158
|
-
isAllowed = false;
|
|
159
133
|
console.log("[Camera.js] <video> stalled:", e);
|
|
160
134
|
reject();
|
|
161
135
|
});
|
|
@@ -181,12 +155,9 @@ function getWebcam({
|
|
|
181
155
|
console.error(err);
|
|
182
156
|
const errMsg = "[Camera.js] " + err.name + ": " + err.message;
|
|
183
157
|
console.error(errMsg);
|
|
184
|
-
isAllowed = false;
|
|
185
158
|
reject();
|
|
186
159
|
}
|
|
187
160
|
});
|
|
188
161
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
getWebcam
|
|
192
|
-
});
|
|
162
|
+
|
|
163
|
+
exports.getWebcam = getWebcam;
|
|
@@ -37,13 +37,4 @@ var angleBetweenPoints = (cx, cy, ex, ey) => {
|
|
|
37
37
|
return theta;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export {
|
|
41
|
-
randRound,
|
|
42
|
-
rand,
|
|
43
|
-
randHalt,
|
|
44
|
-
randInt,
|
|
45
|
-
randFloat,
|
|
46
|
-
degToRad,
|
|
47
|
-
radToDeg,
|
|
48
|
-
angleBetweenPoints
|
|
49
|
-
};
|
|
40
|
+
export { angleBetweenPoints, degToRad, radToDeg, rand, randFloat, randHalt, randInt, randRound };
|
|
@@ -14,11 +14,4 @@ var randomStringByLength = (length, str = textLowCase) => {
|
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export {
|
|
18
|
-
textLowCase,
|
|
19
|
-
numeric,
|
|
20
|
-
punctuation,
|
|
21
|
-
allCharacter,
|
|
22
|
-
randAllCharacterByLength,
|
|
23
|
-
randomStringByLength
|
|
24
|
-
};
|
|
17
|
+
export { allCharacter, numeric, punctuation, randAllCharacterByLength, randomStringByLength, textLowCase };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
|
+
|
|
1
3
|
// src/console/index.ts
|
|
2
4
|
var disableConsole = (params) => {
|
|
3
5
|
for (var key in console) {
|
|
@@ -10,8 +12,4 @@ var showCredit = (params) => {
|
|
|
10
12
|
console.log("Developed by Digitop | https://www.wearetopgroup.com/?utm_src=console");
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
export {
|
|
14
|
-
disableConsole,
|
|
15
|
-
removeConsole,
|
|
16
|
-
showCredit
|
|
17
|
-
};
|
|
15
|
+
export { disableConsole, removeConsole, showCredit };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
|
+
|
|
1
3
|
// src/device/browser.ts
|
|
2
4
|
var isPotrait = () => {
|
|
3
5
|
if (typeof window == "undefined")
|
|
@@ -29,10 +31,4 @@ var isInAppWebview = () => {
|
|
|
29
31
|
return false;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
export {
|
|
33
|
-
isPotrait,
|
|
34
|
-
isLandscape,
|
|
35
|
-
ua,
|
|
36
|
-
isFacebookWebview,
|
|
37
|
-
isInAppWebview
|
|
38
|
-
};
|
|
34
|
+
export { isFacebookWebview, isInAppWebview, isLandscape, isPotrait, ua };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-2R5DRG2S.mjs";
|
|
1
|
+
import { requestCamera } from '../chunk-X3K4KC75.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
4
3
|
|
|
5
4
|
// src/device/camera.ts
|
|
6
5
|
function getWebcam({
|
|
@@ -27,8 +26,6 @@ function getWebcam({
|
|
|
27
26
|
},
|
|
28
27
|
audio
|
|
29
28
|
};
|
|
30
|
-
let stream;
|
|
31
|
-
let isAllowed = false;
|
|
32
29
|
console.log("[Camera.js] Requesting:", requestedMediaConstraints);
|
|
33
30
|
const res = await requestCamera({ audio });
|
|
34
31
|
if (!res) {
|
|
@@ -86,11 +83,9 @@ function getWebcam({
|
|
|
86
83
|
navigator.mediaDevices.enumerateDevices().then(parseDevices).catch(handleError);
|
|
87
84
|
return;
|
|
88
85
|
}
|
|
89
|
-
isAllowed = true;
|
|
90
86
|
playWebcamVideo(stream2);
|
|
91
87
|
}
|
|
92
88
|
function playWebcamVideo(_stream) {
|
|
93
|
-
stream = _stream;
|
|
94
89
|
if ("srcObject" in video) {
|
|
95
90
|
video.srcObject = _stream;
|
|
96
91
|
} else {
|
|
@@ -109,7 +104,6 @@ function getWebcam({
|
|
|
109
104
|
});
|
|
110
105
|
video.addEventListener("error", (e) => console.log("[Camera.js] <video> error:", e));
|
|
111
106
|
video.addEventListener("stalled", function(e) {
|
|
112
|
-
isAllowed = false;
|
|
113
107
|
console.log("[Camera.js] <video> stalled:", e);
|
|
114
108
|
reject();
|
|
115
109
|
});
|
|
@@ -135,12 +129,9 @@ function getWebcam({
|
|
|
135
129
|
console.error(err);
|
|
136
130
|
const errMsg = "[Camera.js] " + err.name + ": " + err.message;
|
|
137
131
|
console.error(errMsg);
|
|
138
|
-
isAllowed = false;
|
|
139
132
|
reject();
|
|
140
133
|
}
|
|
141
134
|
});
|
|
142
135
|
}
|
|
143
136
|
|
|
144
|
-
export {
|
|
145
|
-
getWebcam
|
|
146
|
-
};
|
|
137
|
+
export { getWebcam };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__require
|
|
3
|
-
} from "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { __require } from '../chunk-EZUCZHGV.js';
|
|
4
2
|
|
|
5
3
|
// src/file/createDir.ts
|
|
6
4
|
var fs = __require("fs");
|
|
@@ -11,6 +9,5 @@ function createDir(path) {
|
|
|
11
9
|
}
|
|
12
10
|
fs.mkdirSync(path, { recursive: true });
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
12
|
+
|
|
13
|
+
export { createDir };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__require
|
|
3
|
-
} from "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { __require } from '../chunk-EZUCZHGV.js';
|
|
4
2
|
|
|
5
3
|
// src/file/fileMove.ts
|
|
6
4
|
var fs = __require("fs");
|
|
@@ -27,6 +25,5 @@ function fileMove(oldPath, newPath, callback) {
|
|
|
27
25
|
readStream.pipe(writeStream);
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
28
|
+
|
|
29
|
+
export { fileMove };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__require
|
|
3
|
-
} from "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { __require } from '../chunk-EZUCZHGV.js';
|
|
4
2
|
|
|
5
3
|
// src/file/findFilesByExt.ts
|
|
6
4
|
var path = __require("path");
|
|
@@ -37,6 +35,5 @@ var forEachFileByExt = (base, ext, cb) => {
|
|
|
37
35
|
};
|
|
38
36
|
walk(base);
|
|
39
37
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
38
|
+
|
|
39
|
+
export { forEachFileByExt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
2
|
|
|
3
3
|
// src/math/diffDate.ts
|
|
4
4
|
function diffDate(date1, date2) {
|
|
@@ -6,6 +6,5 @@ function diffDate(date1, date2) {
|
|
|
6
6
|
date2 = date2 || new Date().toString();
|
|
7
7
|
return (new Date(date2).getTime() - new Date(date1).getTime()) / (24 * 60 * 60 * 1e3);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
9
|
+
|
|
10
|
+
export { diffDate };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-A4YWYLCH.mjs";
|
|
4
|
-
import "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { isNull } from '../chunk-HDM7KM5F.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
5
3
|
|
|
6
4
|
// src/math/positiveNumber.ts
|
|
7
5
|
function positiveNumber(number) {
|
|
@@ -14,6 +12,5 @@ function positiveNumber(number) {
|
|
|
14
12
|
return 0;
|
|
15
13
|
return number;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
15
|
+
|
|
16
|
+
export { positiveNumber };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
2
|
|
|
3
3
|
// src/name/en.ts
|
|
4
4
|
function capFirst(string) {
|
|
@@ -13,6 +13,5 @@ function generateName() {
|
|
|
13
13
|
var name = capFirst(name1[getRandomInt(0, name1.length - 1)]) + " " + capFirst(name2[getRandomInt(0, name2.length - 1)]);
|
|
14
14
|
return name;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
16
|
+
|
|
17
|
+
export { generateName };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-QXFH3X2K.mjs";
|
|
4
|
-
import "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { randInt } from '../chunk-5HIQS7HE.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
5
3
|
|
|
6
4
|
// src/array.ts
|
|
7
5
|
var randomIndex = (array) => {
|
|
@@ -29,6 +27,5 @@ var generateName = async (useGender = false, male = false) => {
|
|
|
29
27
|
return randomElement([...MALE, ...FEMALE]);
|
|
30
28
|
}
|
|
31
29
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
30
|
+
|
|
31
|
+
export { generateName };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
2
|
|
|
3
3
|
// src/device.ts
|
|
4
4
|
var isAndroid = () => {
|
|
@@ -171,6 +171,5 @@ var requestDeviceOrientationControl = () => {
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
174
|
+
|
|
175
|
+
export { requestDeviceOrientationControl };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-A4YWYLCH.mjs";
|
|
4
|
-
import "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { toInt } from '../chunk-HDM7KM5F.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
5
3
|
|
|
6
4
|
// src/string/formatNumber.ts
|
|
7
5
|
function formatNumber(num, prefix = "$") {
|
|
8
6
|
const numRound = Math.round((toInt(num) + Number.EPSILON) * 100) / 100;
|
|
9
7
|
return Number.isNaN(numRound) ? "0" : "" + numRound.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, prefix + "1,");
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
9
|
+
|
|
10
|
+
export { formatNumber };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
punctuation,
|
|
4
|
-
randomStringByLength,
|
|
5
|
-
textLowCase
|
|
6
|
-
} from "../chunk-FTE6FZSH.mjs";
|
|
7
|
-
import "../chunk-AKU6F3WT.mjs";
|
|
1
|
+
import { randomStringByLength, textLowCase, numeric, punctuation } from '../chunk-LNLCKCWC.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
8
3
|
|
|
9
4
|
// src/string/generatePassword.ts
|
|
10
5
|
function generatePassword(length = 6, hard = true) {
|
|
@@ -17,6 +12,5 @@ function generatePassword(length = 6, hard = true) {
|
|
|
17
12
|
pass = pass.replace(pass[Math.floor(pass.length / 2)], randomStringByLength(1, punctuation));
|
|
18
13
|
return pass;
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
15
|
+
|
|
16
|
+
export { generatePassword };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
2
|
|
|
3
3
|
// src/string/generateUUID.ts
|
|
4
4
|
var _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"];
|
|
@@ -10,6 +10,5 @@ function generateUUID() {
|
|
|
10
10
|
const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
|
|
11
11
|
return uuid.toLowerCase();
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
13
|
+
|
|
14
|
+
export { generateUUID };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-5AL36RZR.mjs";
|
|
1
|
+
import { isNull } from '../chunk-HDM7KM5F.js';
|
|
2
|
+
import '../chunk-EZUCZHGV.js';
|
|
4
3
|
|
|
5
4
|
// src/string/index.ts
|
|
6
5
|
var char_map = { \u00C0: "A", \u00C1: "A", \u00C2: "A", \u00C3: "A", \u00C4: "A", \u00C5: "A", \u00C6: "AE", \u00C7: "C", \u00C8: "E", \u00C9: "E", \u00CA: "E", \u00CB: "E", \u00CC: "I", \u00CD: "I", \u00CE: "I", \u00CF: "I", \u00D0: "D", \u00D1: "N", \u00D2: "O", \u00D3: "O", \u00D4: "O", \u00D5: "O", \u00D6: "O", \u0150: "O", \u00D8: "O", \u00D9: "U", \u00DA: "U", \u00DB: "U", \u0170: "U", \u00DD: "Y", \u00DE: "TH", \u00DF: "ss", \u00E0: "a", \u00E1: "a", \u00E2: "a", \u00E3: "a", \u00E4: "a", \u00E5: "a", \u00E6: "ae", \u00E8: "e", \u00E9: "e", \u00EA: "e", \u00EB: "e", \u00EC: "i", \u00ED: "i", \u00EE: "i", \u00EF: "i", \u00F0: "d", \u00F1: "n", \u00F2: "o", \u00F3: "o", \u00F4: "o", \u00F5: "o", \u00F6: "o", \u0151: "o", \u00F8: "o", \u00F9: "u", \u00FA: "u", \u00FB: "u", \u0171: "u", \u00FD: "y", \u00FE: "th", \u00FF: "y", "\xA9": "(c)", \u0393: "G", \u0394: "D", \u0398: "8", \u039B: "L", \u039E: "3", \u03A0: "P", \u03A3: "S", \u03A6: "F", \u03A8: "PS", \u03A9: "W", \u0386: "A", \u0388: "E", \u038A: "I", \u038C: "O", \u038E: "Y", \u0389: "H", \u038F: "W", \u03AA: "I", \u03AB: "Y", \u03B2: "b", "\u03B3": "y", \u03B4: "d", \u03B5: "e", \u03B6: "z", \u03B7: "h", \u03B8: "8", \u03B9: "i", \u03BA: "k", \u03BB: "l", \u03BC: "m", \u03BD: "n", \u03BE: "3", \u03BF: "o", \u03C0: "p", \u03C1: "r", \u03C3: "s", \u03C4: "t", \u03C5: "y", \u03C6: "f", \u03C7: "x", \u03C8: "ps", \u03C9: "w", \u03AC: "a", \u03AD: "e", \u03AF: "i", \u03CC: "o", \u03CD: "y", \u03AE: "h", \u03CE: "w", \u03C2: "s", \u03CA: "i", \u03B0: "y", \u03CB: "y", \u0390: "i", \u015E: "S", \u0130: "I", \u00DC: "U", \u011E: "G", \u015F: "s", \u0131: "i", \u00E7: "c", \u00FC: "u", \u011F: "g", \u0410: "A", \u0411: "B", \u0412: "V", \u0413: "G", \u0414: "D", \u0415: "E", \u0401: "Yo", \u0416: "Zh", \u0417: "Z", \u0418: "I", \u0419: "J", \u041A: "K", \u041B: "L", \u041C: "M", \u041D: "N", \u041E: "O", \u041F: "P", \u0420: "R", \u0421: "S", \u0422: "T", \u0423: "U", \u0424: "F", \u0425: "H", \u0426: "C", \u0427: "Ch", \u0428: "Sh", \u0429: "Sh", \u042A: "", \u042B: "Y", \u042C: "", \u042D: "E", \u042E: "Yu", \u042F: "Ya", \u0430: "a", \u0431: "b", \u0432: "v", \u0433: "g", \u0434: "d", \u0435: "e", \u0451: "yo", \u0436: "zh", \u0437: "z", \u0438: "i", \u0439: "j", \u043A: "k", \u043B: "l", \u043C: "m", \u043D: "n", \u043E: "o", \u043F: "p", \u0440: "r", \u0441: "s", \u0442: "t", \u0443: "u", \u0444: "f", \u0445: "h", \u0446: "c", \u0447: "ch", \u0448: "sh", \u0449: "sh", \u044A: "", \u044B: "y", \u044C: "", \u044D: "e", \u044E: "yu", \u044F: "ya", \u0404: "Ye", \u0406: "I", \u0407: "Yi", \u0490: "G", \u0454: "ye", \u0456: "i", \u0457: "yi", \u0491: "g", \u010C: "C", \u010E: "D", \u011A: "E", \u0147: "N", \u0158: "R", \u0160: "S", \u0164: "T", \u016E: "U", \u017D: "Z", \u010D: "c", \u010F: "d", \u011B: "e", \u0148: "n", \u0159: "r", \u0161: "s", \u0165: "t", \u016F: "u", \u017E: "z", \u0104: "A", \u0106: "C", \u0118: "e", \u0141: "L", \u0143: "N", \u015A: "S", \u0179: "Z", \u017B: "Z", \u0105: "a", \u0107: "c", \u0119: "e", \u0142: "l", \u0144: "n", \u015B: "s", \u017A: "z", \u017C: "z", \u0100: "A", \u0112: "E", \u0122: "G", \u012A: "i", \u0136: "k", \u013B: "L", \u0145: "N", \u016A: "u", \u0101: "a", \u0113: "e", \u0123: "g", \u012B: "i", \u0137: "k", \u013C: "l", \u0146: "n", \u016B: "u" };
|
|
@@ -84,13 +83,4 @@ var clearUnicodeCharacters = (s, opt = {}) => {
|
|
|
84
83
|
return opt.lowercase ? s.toLowerCase() : s;
|
|
85
84
|
};
|
|
86
85
|
|
|
87
|
-
export {
|
|
88
|
-
getBetween,
|
|
89
|
-
makeString,
|
|
90
|
-
toUpperCase,
|
|
91
|
-
toLowerCase,
|
|
92
|
-
titleize,
|
|
93
|
-
capitalize,
|
|
94
|
-
capitalizeName,
|
|
95
|
-
clearUnicodeCharacters
|
|
96
|
-
};
|
|
86
|
+
export { capitalize, capitalizeName, clearUnicodeCharacters, getBetween, makeString, titleize, toLowerCase, toUpperCase };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../chunk-EZUCZHGV.js';
|
|
2
|
+
import trim from 'lodash/trim';
|
|
2
3
|
|
|
3
|
-
// src/string/trimNull.ts
|
|
4
|
-
import trim from "lodash/trim";
|
|
5
4
|
function trimNull(str) {
|
|
6
5
|
if (!str)
|
|
7
6
|
return "";
|
|
@@ -11,6 +10,5 @@ function trimNull(str) {
|
|
|
11
10
|
str = trim(str);
|
|
12
11
|
return str;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
13
|
+
|
|
14
|
+
export { trimNull };
|