diginext-utils 2.0.3 → 2.0.5
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/.DS_Store +0 -0
- package/dist/Checker.js +26 -5
- package/dist/Checker.mjs +4 -3
- package/dist/EventDispatcher.d.ts +1 -1
- package/dist/EventDispatcher.js +26 -3
- package/dist/EventDispatcher.mjs +4 -3
- package/dist/FileUpload.d.ts +1 -1
- package/dist/FileUpload.js +26 -4
- package/dist/FileUpload.mjs +4 -4
- package/dist/Slug.js +26 -5
- package/dist/Slug.mjs +4 -3
- package/dist/Timer.d.ts +1 -1
- package/dist/Timer.js +26 -4
- package/dist/Timer.mjs +7 -2
- package/dist/Validation.d.ts +2 -2
- package/dist/Validation.js +27 -4
- package/dist/Validation.mjs +5 -4
- package/dist/array.js +66 -23
- package/dist/array.mjs +44 -3
- package/dist/{chunk-JKYSZLBF.mjs → chunk-2R5DRG2S.mjs} +3 -2
- package/dist/{chunk-7IYY7BKN.mjs → chunk-3NMJTC44.mjs} +13 -3
- package/dist/chunk-5AL36RZR.mjs +8 -1
- package/dist/chunk-7UXN7I4K.mjs +13 -2
- package/dist/chunk-A4YWYLCH.mjs +23 -0
- package/dist/chunk-AHFJBIQJ.mjs +4 -3
- package/dist/chunk-AKU6F3WT.mjs +3 -1
- package/dist/chunk-ALNAD4H7.mjs +10 -0
- package/dist/chunk-FOWYH6LL.mjs +7 -1
- package/dist/chunk-FTE6FZSH.mjs +8 -1
- package/dist/chunk-LXQIKFED.mjs +5 -1
- package/dist/{chunk-VZGV2BTL.mjs → chunk-NLQXFCPR.mjs} +6 -3
- package/dist/{chunk-VFKAZAWF.mjs → chunk-QXFH3X2K.mjs} +11 -2
- package/dist/{chunk-Q5R25OIS.mjs → chunk-S2U7F2JJ.mjs} +24 -2
- package/dist/chunk-UKRVCU5M.mjs +6 -1
- package/dist/color.js +36 -10
- package/dist/color.mjs +9 -3
- package/dist/console/enableConsole.d.ts +1 -1
- package/dist/console/enableConsole.js +34 -10
- package/dist/console/enableConsole.mjs +11 -2
- package/dist/console/index.js +30 -7
- package/dist/console/index.mjs +18 -2
- package/dist/device/browser.js +34 -9
- package/dist/device/browser.mjs +39 -2
- package/dist/device/camera.js +34 -6
- package/dist/device/camera.mjs +146 -3
- package/dist/device.js +32 -8
- package/dist/device.mjs +13 -2
- package/dist/file/createDir.d.ts +1 -1
- package/dist/file/createDir.js +27 -12
- package/dist/file/createDir.mjs +6 -3
- package/dist/file/fileMove.d.ts +1 -1
- package/dist/file/fileMove.js +27 -12
- package/dist/file/fileMove.mjs +6 -3
- package/dist/file/findFilesByExt.d.ts +1 -1
- package/dist/file/findFilesByExt.js +28 -14
- package/dist/file/findFilesByExt.mjs +6 -4
- package/dist/index.d.ts +5 -5
- package/dist/index.js +159 -73
- package/dist/index.mjs +143 -13
- package/dist/math/diffDate.d.ts +1 -1
- package/dist/math/diffDate.js +26 -3
- package/dist/math/diffDate.mjs +4 -3
- package/dist/{math.d.ts → math/index.d.ts} +0 -0
- package/dist/math/index.js +79 -0
- package/dist/math/index.mjs +21 -0
- package/dist/math/positiveNumber.d.ts +1 -1
- package/dist/math/positiveNumber.js +28 -3
- package/dist/math/positiveNumber.mjs +7 -4
- package/dist/name/en.js +26 -5
- package/dist/name/en.mjs +4 -3
- package/dist/name/vi.js +30 -5
- package/dist/name/vi.mjs +19 -5
- package/dist/object.js +36 -10
- package/dist/object.mjs +17 -2
- package/dist/permission/requestCamera.d.ts +1 -1
- package/dist/permission/requestCamera.js +26 -4
- package/dist/permission/requestCamera.mjs +7 -2
- package/dist/permission/requestDeviceOrientationControl.d.ts +1 -1
- package/dist/permission/requestDeviceOrientationControl.js +28 -4
- package/dist/permission/requestDeviceOrientationControl.mjs +176 -3
- package/dist/string/formatNumber.d.ts +1 -1
- package/dist/string/formatNumber.js +28 -3
- package/dist/string/formatNumber.mjs +7 -4
- package/dist/string/generatePassword.d.ts +1 -1
- package/dist/string/generatePassword.js +28 -3
- package/dist/string/generatePassword.mjs +10 -4
- package/dist/string/generateUUID.d.ts +1 -1
- package/dist/string/generateUUID.js +26 -3
- package/dist/string/generateUUID.mjs +4 -3
- package/dist/string/index.js +41 -11
- package/dist/string/index.mjs +96 -3
- package/dist/string/random.js +36 -10
- package/dist/string/random.mjs +17 -2
- package/dist/string/trimNull.d.ts +1 -1
- package/dist/string/trimNull.js +34 -10
- package/dist/string/trimNull.mjs +6 -4
- package/dist/string/url.js +40 -10
- package/dist/string/url.mjs +14 -4
- package/package.json +7 -8
- package/dist/math.js +0 -51
- package/dist/math.mjs +0 -2
package/dist/device/camera.mjs
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
requestCamera
|
|
3
|
+
} from "../chunk-2R5DRG2S.mjs";
|
|
4
|
+
import "../chunk-AKU6F3WT.mjs";
|
|
5
|
+
|
|
6
|
+
// src/device/camera.ts
|
|
7
|
+
function getWebcam({
|
|
8
|
+
container,
|
|
9
|
+
facingMode = "environment",
|
|
10
|
+
audio = false
|
|
11
|
+
}) {
|
|
12
|
+
if (typeof window == "undefined")
|
|
13
|
+
return;
|
|
14
|
+
container = container || document.body;
|
|
15
|
+
return new Promise(async (resolve, reject) => {
|
|
16
|
+
const video = document.createElement("video");
|
|
17
|
+
video.style.position = "absolute";
|
|
18
|
+
video.style.top = "0";
|
|
19
|
+
video.style.left = "0";
|
|
20
|
+
video.style.width = "100%";
|
|
21
|
+
video.style.height = "100%";
|
|
22
|
+
container.append(video);
|
|
23
|
+
let inputCameras = [];
|
|
24
|
+
let currentCamera;
|
|
25
|
+
const requestedMediaConstraints = {
|
|
26
|
+
video: {
|
|
27
|
+
facingMode: { exact: facingMode }
|
|
28
|
+
},
|
|
29
|
+
audio
|
|
30
|
+
};
|
|
31
|
+
let stream;
|
|
32
|
+
let isAllowed = false;
|
|
33
|
+
console.log("[Camera.js] Requesting:", requestedMediaConstraints);
|
|
34
|
+
const res = await requestCamera({ audio });
|
|
35
|
+
if (!res) {
|
|
36
|
+
setTimeout(function() {
|
|
37
|
+
handleError({ name: "Error", message: "NotSupported" });
|
|
38
|
+
}, 50);
|
|
39
|
+
}
|
|
40
|
+
navigator.mediaDevices.enumerateDevices().then(parseDevices).catch(handleError);
|
|
41
|
+
function parseDevices(devices) {
|
|
42
|
+
inputCameras = [];
|
|
43
|
+
let backCameras = [];
|
|
44
|
+
devices.forEach(function(device) {
|
|
45
|
+
if (device.kind == "videoinput" && typeof device.deviceId != "undefined" && device.deviceId != "") {
|
|
46
|
+
inputCameras.push(device);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
console.log("[Camera.js] inputCameras:", inputCameras);
|
|
50
|
+
if (inputCameras.length > 0) {
|
|
51
|
+
let cams = "";
|
|
52
|
+
let backCamera;
|
|
53
|
+
inputCameras.map((cam, index) => {
|
|
54
|
+
cams += `[${cam.deviceId}] ${cam.kind} | ${cam.label}
|
|
55
|
+
`;
|
|
56
|
+
let label = cam.label.toLowerCase();
|
|
57
|
+
if (label.indexOf("back") > -1 || label.indexOf("facetime") > -1) {
|
|
58
|
+
backCamera = cam;
|
|
59
|
+
backCameras.push(backCamera);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (backCameras.length > 1) {
|
|
63
|
+
backCamera = backCameras[backCameras.length - 1];
|
|
64
|
+
}
|
|
65
|
+
console.log(`[Camera.js] All input sources:`, cams);
|
|
66
|
+
console.log(`[Camera.js] This device has ${backCameras.length} back camera${backCameras.length > 1 ? "s" : ""}.`);
|
|
67
|
+
console.log("[Camera.js] backCameras:", JSON.stringify(backCameras));
|
|
68
|
+
currentCamera = backCamera;
|
|
69
|
+
getStreamOfCameraId(backCamera.deviceId).then(onStreamReceived).catch((e) => {
|
|
70
|
+
if (backCameras.length > 1) {
|
|
71
|
+
backCamera = backCameras[backCameras.length - 2];
|
|
72
|
+
getStreamOfCameraId(backCamera.deviceId).then(onStreamReceived).catch(handleError);
|
|
73
|
+
} else if (backCameras.length > 2) {
|
|
74
|
+
backCamera = backCameras[backCameras.length - 3];
|
|
75
|
+
getStreamOfCameraId(backCamera.deviceId).then(onStreamReceived).catch(handleError);
|
|
76
|
+
} else {
|
|
77
|
+
handleError(e);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
navigator.mediaDevices.getUserMedia(requestedMediaConstraints).then(onStreamReceived).catch(handleError);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function onStreamReceived(stream2) {
|
|
85
|
+
if (inputCameras.length == 0) {
|
|
86
|
+
console.log("[Camera.js] Not found any back cameras, request again?");
|
|
87
|
+
navigator.mediaDevices.enumerateDevices().then(parseDevices).catch(handleError);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
isAllowed = true;
|
|
91
|
+
playWebcamVideo(stream2);
|
|
92
|
+
}
|
|
93
|
+
function playWebcamVideo(_stream) {
|
|
94
|
+
stream = _stream;
|
|
95
|
+
if ("srcObject" in video) {
|
|
96
|
+
video.srcObject = _stream;
|
|
97
|
+
} else {
|
|
98
|
+
video.src = window.URL.createObjectURL(_stream);
|
|
99
|
+
}
|
|
100
|
+
video.setAttribute("playsinline", "true");
|
|
101
|
+
video.setAttribute("muted", "true");
|
|
102
|
+
video.setAttribute("autoplay", "true");
|
|
103
|
+
video.muted = true;
|
|
104
|
+
video.autoplay = true;
|
|
105
|
+
video.style.objectFit = "cover";
|
|
106
|
+
video.play();
|
|
107
|
+
video.addEventListener("canplay", function(e) {
|
|
108
|
+
});
|
|
109
|
+
video.addEventListener("canplaythrough", function(e) {
|
|
110
|
+
});
|
|
111
|
+
video.addEventListener("error", (e) => console.log("[Camera.js] <video> error:", e));
|
|
112
|
+
video.addEventListener("stalled", function(e) {
|
|
113
|
+
isAllowed = false;
|
|
114
|
+
console.log("[Camera.js] <video> stalled:", e);
|
|
115
|
+
reject();
|
|
116
|
+
});
|
|
117
|
+
video.addEventListener("loadedmetadata", function(e) {
|
|
118
|
+
if (currentCamera.label.toLowerCase().indexOf("facetime") > -1) {
|
|
119
|
+
video.style.transform = "scaleX(-1)";
|
|
120
|
+
video.style.webkitTransform = "scaleX(-1)";
|
|
121
|
+
}
|
|
122
|
+
video.play();
|
|
123
|
+
resolve(video);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function getStreamOfCameraId(id) {
|
|
127
|
+
const constraints = {
|
|
128
|
+
video: { deviceId: { exact: id } },
|
|
129
|
+
audio: false
|
|
130
|
+
};
|
|
131
|
+
return new Promise((resolve2, reject2) => {
|
|
132
|
+
navigator.mediaDevices.getUserMedia(constraints).then(resolve2).catch(reject2);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function handleError(err) {
|
|
136
|
+
console.error(err);
|
|
137
|
+
const errMsg = "[Camera.js] " + err.name + ": " + err.message;
|
|
138
|
+
console.error(errMsg);
|
|
139
|
+
isAllowed = false;
|
|
140
|
+
reject();
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
getWebcam
|
|
146
|
+
};
|
package/dist/device.js
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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);
|
|
4
18
|
|
|
5
19
|
// src/device.ts
|
|
20
|
+
var device_exports = {};
|
|
21
|
+
__export(device_exports, {
|
|
22
|
+
checkOS: () => checkOS,
|
|
23
|
+
isAndroid: () => isAndroid,
|
|
24
|
+
isIos: () => isIos,
|
|
25
|
+
isMobile: () => isMobile
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(device_exports);
|
|
6
28
|
var isIos = () => {
|
|
7
29
|
const deviceInfo2 = checkOS();
|
|
8
30
|
if (deviceInfo2)
|
|
@@ -166,8 +188,10 @@ var checkOS = () => {
|
|
|
166
188
|
}
|
|
167
189
|
return deviceInfo;
|
|
168
190
|
};
|
|
169
|
-
|
|
170
|
-
exports
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
checkOS,
|
|
194
|
+
isAndroid,
|
|
195
|
+
isIos,
|
|
196
|
+
isMobile
|
|
197
|
+
});
|
package/dist/device.mjs
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
checkOS,
|
|
3
|
+
isAndroid,
|
|
4
|
+
isIos,
|
|
5
|
+
isMobile
|
|
6
|
+
} from "./chunk-UKRVCU5M.mjs";
|
|
7
|
+
import "./chunk-AKU6F3WT.mjs";
|
|
8
|
+
export {
|
|
9
|
+
checkOS,
|
|
10
|
+
isAndroid,
|
|
11
|
+
isIos,
|
|
12
|
+
isMobile
|
|
13
|
+
};
|
package/dist/file/createDir.d.ts
CHANGED
package/dist/file/createDir.js
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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);
|
|
10
18
|
|
|
11
19
|
// src/file/createDir.ts
|
|
12
|
-
var
|
|
20
|
+
var createDir_exports = {};
|
|
21
|
+
__export(createDir_exports, {
|
|
22
|
+
createDir: () => createDir
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(createDir_exports);
|
|
25
|
+
var fs = require("fs");
|
|
13
26
|
function createDir(path) {
|
|
14
27
|
if (fs.existsSync(path)) {
|
|
15
28
|
console.log("directory already exited !");
|
|
@@ -17,5 +30,7 @@ function createDir(path) {
|
|
|
17
30
|
}
|
|
18
31
|
fs.mkdirSync(path, { recursive: true });
|
|
19
32
|
}
|
|
20
|
-
|
|
21
|
-
module.exports =
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
createDir
|
|
36
|
+
});
|
package/dist/file/createDir.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "../chunk-AKU6F3WT.mjs";
|
|
2
4
|
|
|
3
5
|
// src/file/createDir.ts
|
|
4
6
|
var fs = __require("fs");
|
|
@@ -9,5 +11,6 @@ function createDir(path) {
|
|
|
9
11
|
}
|
|
10
12
|
fs.mkdirSync(path, { recursive: true });
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
export {
|
|
15
|
+
createDir
|
|
16
|
+
};
|
package/dist/file/fileMove.d.ts
CHANGED
package/dist/file/fileMove.js
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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);
|
|
10
18
|
|
|
11
19
|
// src/file/fileMove.ts
|
|
12
|
-
var
|
|
20
|
+
var fileMove_exports = {};
|
|
21
|
+
__export(fileMove_exports, {
|
|
22
|
+
fileMove: () => fileMove
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(fileMove_exports);
|
|
25
|
+
var fs = require("fs");
|
|
13
26
|
function fileMove(oldPath, newPath, callback) {
|
|
14
27
|
fs.rename(oldPath, newPath, function(err) {
|
|
15
28
|
if (err) {
|
|
@@ -33,5 +46,7 @@ function fileMove(oldPath, newPath, callback) {
|
|
|
33
46
|
readStream.pipe(writeStream);
|
|
34
47
|
}
|
|
35
48
|
}
|
|
36
|
-
|
|
37
|
-
module.exports =
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
fileMove
|
|
52
|
+
});
|
package/dist/file/fileMove.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "../chunk-AKU6F3WT.mjs";
|
|
2
4
|
|
|
3
5
|
// src/file/fileMove.ts
|
|
4
6
|
var fs = __require("fs");
|
|
@@ -25,5 +27,6 @@ function fileMove(oldPath, newPath, callback) {
|
|
|
25
27
|
readStream.pipe(writeStream);
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
export {
|
|
31
|
+
fileMove
|
|
32
|
+
};
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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);
|
|
10
18
|
|
|
11
19
|
// src/file/findFilesByExt.ts
|
|
12
|
-
var
|
|
13
|
-
|
|
20
|
+
var findFilesByExt_exports = {};
|
|
21
|
+
__export(findFilesByExt_exports, {
|
|
22
|
+
forEachFileByExt: () => forEachFileByExt
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(findFilesByExt_exports);
|
|
25
|
+
var path = require("path");
|
|
26
|
+
var fs = require("fs");
|
|
14
27
|
var forEachFileByExt = (base, ext, cb) => {
|
|
15
28
|
var walk = function(directoryName) {
|
|
16
29
|
try {
|
|
@@ -43,6 +56,7 @@ var forEachFileByExt = (base, ext, cb) => {
|
|
|
43
56
|
};
|
|
44
57
|
walk(base);
|
|
45
58
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
forEachFileByExt
|
|
62
|
+
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "../chunk-AKU6F3WT.mjs";
|
|
2
4
|
|
|
3
5
|
// src/file/findFilesByExt.ts
|
|
4
6
|
var path = __require("path");
|
|
@@ -35,6 +37,6 @@ var forEachFileByExt = (base, ext, cb) => {
|
|
|
35
37
|
};
|
|
36
38
|
walk(base);
|
|
37
39
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
export {
|
|
41
|
+
forEachFileByExt
|
|
42
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export { checkOS, isAndroid, isIos, isMobile } from './device.js';
|
|
|
3
3
|
export { disableConsole, removeConsole, showCredit } from './console/index.js';
|
|
4
4
|
export { isFacebookWebview, isInAppWebview, isLandscape, isPotrait, ua } from './device/browser.js';
|
|
5
5
|
export { getWebcam } from './device/camera.js';
|
|
6
|
-
export { angleBetweenPoints, degToRad, radToDeg, rand, randFloat, randHalt, randInt, randRound } from './math.js';
|
|
6
|
+
export { angleBetweenPoints, degToRad, radToDeg, rand, randFloat, randHalt, randInt, randRound } from './math/index.js';
|
|
7
7
|
export { isNull, objectToArray, toArray, toBool, toFloat, toInt } from './object.js';
|
|
8
8
|
export { capitalize, capitalizeName, clearUnicodeCharacters, getBetween, makeString, titleize, toLowerCase, toUpperCase } from './string/index.js';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
9
|
+
export { Timer } from './Timer.js';
|
|
10
|
+
export { requestCamera } from './permission/requestCamera.js';
|
|
11
|
+
export { requestDeviceOrientationControl } from './permission/requestDeviceOrientationControl.js';
|
|
12
|
+
export { enableConsole } from './console/enableConsole.js';
|