diginext-utils 4.0.26 → 4.0.27
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/esm/array/average.js +1 -1
- package/esm/array/index.js +22 -22
- package/esm/array/randomElement.js +1 -1
- package/esm/array.js +1 -1
- package/esm/cached/CacheManager.js +1 -1
- package/esm/cached/index.js +1 -1
- package/esm/date/index.js +2 -2
- package/esm/device/camera.js +1 -1
- package/esm/email/index.js +1 -1
- package/esm/file/detectPrivateKey.js +2 -2
- package/esm/file/detectPrivateKeyByFilePath.js +1 -1
- package/esm/file/index.js +7 -7
- package/esm/html/index.js +1 -1
- package/esm/images/downloadByUrl.js +3 -3
- package/esm/images/index.js +4 -4
- package/esm/images/loadImageAsBlobUrl.js +1 -1
- package/esm/images/upload.js +3 -3
- package/esm/index.js +36 -36
- package/esm/lib/index.js +1 -1
- package/esm/math/index.js +2 -2
- package/esm/math/positiveNumber.js +1 -1
- package/esm/name/index.js +2 -2
- package/esm/name/vi.js +1 -1
- package/esm/object/index.js +14 -14
- package/esm/object/isEqual.js +1 -1
- package/esm/object/merge.js +1 -1
- package/esm/object/toArray.js +1 -1
- package/esm/object/toBool.js +2 -2
- package/esm/object/toFloat.js +1 -1
- package/esm/object/toInt.js +1 -1
- package/esm/package.json +3 -0
- package/esm/permission/index.js +2 -2
- package/esm/permission/requestDeviceOrientationControl.js +1 -1
- package/esm/response/index.js +1 -1
- package/esm/string/convertPathnameAndQuery.js +1 -1
- package/esm/string/formatNumber.js +1 -1
- package/esm/string/generatePassword.js +1 -1
- package/esm/string/getIntFromNextJsRouter.js +1 -1
- package/esm/string/getStringFromNextJsRouter.js +1 -1
- package/esm/string/getTextBetweenCharByIndex.js +1 -1
- package/esm/string/index.js +11 -11
- package/esm/string/makeSlug.js +1 -1
- package/esm/string/trimNull.js +1 -1
- package/esm/xconsole/enableConsole.js +1 -1
- package/esm/xconsole/index.js +1 -1
- package/package.json +198 -27
package/esm/array/average.js
CHANGED
package/esm/array/index.js
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
* Array utility functions
|
|
3
3
|
* @module array
|
|
4
4
|
*/
|
|
5
|
-
export { sum } from "./sum";
|
|
6
|
-
export { average } from "./average";
|
|
7
|
-
export { min } from "./min";
|
|
8
|
-
export { max } from "./max";
|
|
9
|
-
export { sortByString } from "./sortByString";
|
|
10
|
-
export { sortByNumber } from "./sortByNumber";
|
|
11
|
-
export { first } from "./first";
|
|
12
|
-
export { last } from "./last";
|
|
13
|
-
export { randomIndex } from "./randomIndex";
|
|
14
|
-
export { randomElement } from "./randomElement";
|
|
15
|
-
export { unique } from "./unique";
|
|
16
|
-
export { intersection } from "./intersection";
|
|
17
|
-
export { removeItem } from "./removeItem";
|
|
18
|
-
export { removeItemByKey } from "./removeItemByKey";
|
|
19
|
-
export { sample } from "./sample";
|
|
20
|
-
export { shuffle } from "./shuffle";
|
|
21
|
-
export { moveElement } from "./moveElement";
|
|
22
|
-
export { chunk } from "./chunk";
|
|
23
|
-
export { compact } from "./compact";
|
|
24
|
-
export { flatten } from "./flatten";
|
|
25
|
-
export { difference } from "./difference";
|
|
26
|
-
export { union } from "./union";
|
|
5
|
+
export { sum } from "./sum.js";
|
|
6
|
+
export { average } from "./average.js";
|
|
7
|
+
export { min } from "./min.js";
|
|
8
|
+
export { max } from "./max.js";
|
|
9
|
+
export { sortByString } from "./sortByString.js";
|
|
10
|
+
export { sortByNumber } from "./sortByNumber.js";
|
|
11
|
+
export { first } from "./first.js";
|
|
12
|
+
export { last } from "./last.js";
|
|
13
|
+
export { randomIndex } from "./randomIndex.js";
|
|
14
|
+
export { randomElement } from "./randomElement.js";
|
|
15
|
+
export { unique } from "./unique.js";
|
|
16
|
+
export { intersection } from "./intersection.js";
|
|
17
|
+
export { removeItem } from "./removeItem.js";
|
|
18
|
+
export { removeItemByKey } from "./removeItemByKey.js";
|
|
19
|
+
export { sample } from "./sample.js";
|
|
20
|
+
export { shuffle } from "./shuffle.js";
|
|
21
|
+
export { moveElement } from "./moveElement.js";
|
|
22
|
+
export { chunk } from "./chunk.js";
|
|
23
|
+
export { compact } from "./compact.js";
|
|
24
|
+
export { flatten } from "./flatten.js";
|
|
25
|
+
export { difference } from "./difference.js";
|
|
26
|
+
export { union } from "./union.js";
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/esm/array.js
CHANGED
package/esm/cached/index.js
CHANGED
package/esm/date/index.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Date utility functions
|
|
3
3
|
* @module date
|
|
4
4
|
*/
|
|
5
|
-
export { default as timeAgo } from "./timeAgo";
|
|
6
|
-
export { diffDate } from "../math/diffDate";
|
|
5
|
+
export { default as timeAgo } from "./timeAgo.js";
|
|
6
|
+
export { diffDate } from "../math/diffDate.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/esm/device/camera.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { requestCamera } from "../permission/requestCamera";
|
|
10
|
+
import { requestCamera } from "../permission/requestCamera.js";
|
|
11
11
|
export function getWebcam(params = { facingMode: "environment", audio: true }) {
|
|
12
12
|
if (typeof window == "undefined")
|
|
13
13
|
return;
|
package/esm/email/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import validate from "deep-email-validator";
|
|
11
|
-
import toString from "lodash/toString";
|
|
11
|
+
import toString from "lodash/toString.js";
|
|
12
12
|
function extractReasons(emailValidatorOutput) {
|
|
13
13
|
const reasons = [];
|
|
14
14
|
// Loop through each validator
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import getAllFiles from "./getAllFiles";
|
|
2
|
-
import detectPrivateKeyByFilePath from "./detectPrivateKeyByFilePath";
|
|
1
|
+
import getAllFiles from "./getAllFiles.js";
|
|
2
|
+
import detectPrivateKeyByFilePath from "./detectPrivateKeyByFilePath.js";
|
|
3
3
|
export default function detectPrivateKey(dirPath) {
|
|
4
4
|
//
|
|
5
5
|
const list = getAllFiles(dirPath);
|
package/esm/file/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createDir } from "./createDir";
|
|
2
|
-
import detectPrivateKey from "./detectPrivateKey";
|
|
3
|
-
import detectPrivateKeyByFilePath from "./detectPrivateKeyByFilePath";
|
|
4
|
-
import { fileMove } from "./fileMove";
|
|
5
|
-
import fileExt, { findFileByExt, forEachFileByExt } from "./findFilesByExt";
|
|
6
|
-
import getAllFiles from "./getAllFiles";
|
|
7
|
-
import parseEnvFile from "./parseEnvFile";
|
|
1
|
+
import { createDir } from "./createDir.js";
|
|
2
|
+
import detectPrivateKey from "./detectPrivateKey.js";
|
|
3
|
+
import detectPrivateKeyByFilePath from "./detectPrivateKeyByFilePath.js";
|
|
4
|
+
import { fileMove } from "./fileMove.js";
|
|
5
|
+
import fileExt, { findFileByExt, forEachFileByExt } from "./findFilesByExt.js";
|
|
6
|
+
import getAllFiles from "./getAllFiles.js";
|
|
7
|
+
import parseEnvFile from "./parseEnvFile.js";
|
|
8
8
|
const xfile = {
|
|
9
9
|
createDir,
|
|
10
10
|
detectPrivateKey,
|
package/esm/html/index.js
CHANGED
|
@@ -8,9 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import saveAs from "file-saver";
|
|
11
|
-
import { isMobile } from "../device/index";
|
|
12
|
-
import { randomFileName } from "../string/random";
|
|
13
|
-
import { getExtensionFromMimeType, getFileNameWithExtension } from "../string/url";
|
|
11
|
+
import { isMobile } from "../device/index.js";
|
|
12
|
+
import { randomFileName } from "../string/random.js";
|
|
13
|
+
import { getExtensionFromMimeType, getFileNameWithExtension } from "../string/url.js";
|
|
14
14
|
export const doGetFile = (url, data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
15
|
const response = yield fetch(url);
|
|
16
16
|
if (!response.ok) {
|
package/esm/images/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./upload";
|
|
2
|
-
export * from "./resize";
|
|
3
|
-
export * from "./loadImage";
|
|
4
|
-
export * from "./downloadByUrl";
|
|
1
|
+
export * from "./upload.js";
|
|
2
|
+
export * from "./resize.js";
|
|
3
|
+
export * from "./loadImage.js";
|
|
4
|
+
export * from "./downloadByUrl.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import getUrlBypassCors from "./getUrlBypassCors";
|
|
10
|
+
import getUrlBypassCors from "./getUrlBypassCors.js";
|
|
11
11
|
const tryLoad = (url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
12
|
const response = yield fetch(url, {
|
|
13
13
|
// mode: "cors",
|
package/esm/images/upload.js
CHANGED
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { getFailedResponse } from "./../response/index";
|
|
11
|
-
import resize from "./resize";
|
|
12
|
-
import { isImage } from "./../string/url";
|
|
10
|
+
import { getFailedResponse } from "./../response/index.js";
|
|
11
|
+
import resize from "./resize.js";
|
|
12
|
+
import { isImage } from "./../string/url.js";
|
|
13
13
|
export const upload = (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
const { name } = file;
|
|
15
15
|
if (!isImage(name)) {
|
package/esm/index.js
CHANGED
|
@@ -3,48 +3,48 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
// Re-export all modules as namespaces
|
|
6
|
-
export * as array from "./array";
|
|
7
|
-
export * as object from "./object";
|
|
8
|
-
export * as math from "./math";
|
|
9
|
-
export * as string from "./string";
|
|
10
|
-
export * as file from "./file";
|
|
11
|
-
export * as device from "./device";
|
|
12
|
-
export * as date from "./date";
|
|
13
|
-
export * as email from "./email";
|
|
14
|
-
export * as gameboi from "./gameboi";
|
|
15
|
-
export * as images from "./images";
|
|
16
|
-
export * as name from "./name";
|
|
17
|
-
export * as permission from "./permission";
|
|
18
|
-
export * as response from "./response";
|
|
19
|
-
export * as xconsole from "./xconsole";
|
|
20
|
-
export * as cached from "./cached";
|
|
21
|
-
export * as html from "./html";
|
|
22
|
-
export * as lib from "./lib";
|
|
23
|
-
export * as slug from "./Slug";
|
|
6
|
+
export * as array from "./array.js";
|
|
7
|
+
export * as object from "./object.js";
|
|
8
|
+
export * as math from "./math.js";
|
|
9
|
+
export * as string from "./string.js";
|
|
10
|
+
export * as file from "./file.js";
|
|
11
|
+
export * as device from "./device.js";
|
|
12
|
+
export * as date from "./date.js";
|
|
13
|
+
export * as email from "./email.js";
|
|
14
|
+
export * as gameboi from "./gameboi.js";
|
|
15
|
+
export * as images from "./images.js";
|
|
16
|
+
export * as name from "./name.js";
|
|
17
|
+
export * as permission from "./permission.js";
|
|
18
|
+
export * as response from "./response.js";
|
|
19
|
+
export * as xconsole from "./xconsole.js";
|
|
20
|
+
export * as cached from "./cached.js";
|
|
21
|
+
export * as html from "./html.js";
|
|
22
|
+
export * as lib from "./lib.js";
|
|
23
|
+
export * as slug from "./Slug.js";
|
|
24
24
|
// For tree-shaking, users can import directly from subpaths:
|
|
25
25
|
// import { sum, average } from 'diginext-utils/array'
|
|
26
26
|
// import { isNull, toBool } from 'diginext-utils/object'
|
|
27
27
|
// import { randomInt, clamp } from 'diginext-utils/math'
|
|
28
28
|
// Backward compatibility - default export
|
|
29
29
|
// Note: This uses dynamic imports which may not work in all environments
|
|
30
|
-
import * as arrayModule from "./array";
|
|
31
|
-
import * as objectModule from "./object";
|
|
32
|
-
import * as mathModule from "./math";
|
|
33
|
-
import * as stringModule from "./string";
|
|
34
|
-
import * as fileModule from "./file";
|
|
35
|
-
import * as deviceModule from "./device";
|
|
36
|
-
import * as dateModule from "./date";
|
|
37
|
-
import * as emailModule from "./email";
|
|
38
|
-
import * as gameboiModule from "./gameboi";
|
|
39
|
-
import * as imagesModule from "./images";
|
|
40
|
-
import * as nameModule from "./name";
|
|
41
|
-
import * as permissionModule from "./permission";
|
|
42
|
-
import * as responseModule from "./response";
|
|
43
|
-
import * as xconsoleModule from "./xconsole";
|
|
44
|
-
import * as cachedModule from "./cached";
|
|
45
|
-
import * as htmlModule from "./html";
|
|
46
|
-
import * as libModule from "./lib";
|
|
47
|
-
import * as slugModule from "./Slug";
|
|
30
|
+
import * as arrayModule from "./array.js";
|
|
31
|
+
import * as objectModule from "./object.js";
|
|
32
|
+
import * as mathModule from "./math.js";
|
|
33
|
+
import * as stringModule from "./string.js";
|
|
34
|
+
import * as fileModule from "./file.js";
|
|
35
|
+
import * as deviceModule from "./device.js";
|
|
36
|
+
import * as dateModule from "./date.js";
|
|
37
|
+
import * as emailModule from "./email.js";
|
|
38
|
+
import * as gameboiModule from "./gameboi.js";
|
|
39
|
+
import * as imagesModule from "./images.js";
|
|
40
|
+
import * as nameModule from "./name.js";
|
|
41
|
+
import * as permissionModule from "./permission.js";
|
|
42
|
+
import * as responseModule from "./response.js";
|
|
43
|
+
import * as xconsoleModule from "./xconsole.js";
|
|
44
|
+
import * as cachedModule from "./cached.js";
|
|
45
|
+
import * as htmlModule from "./html.js";
|
|
46
|
+
import * as libModule from "./lib.js";
|
|
47
|
+
import * as slugModule from "./Slug.js";
|
|
48
48
|
/**
|
|
49
49
|
* Default export maintaining backward compatibility
|
|
50
50
|
* @deprecated Use named exports instead for better tree-shaking
|
package/esm/lib/index.js
CHANGED
package/esm/math/index.js
CHANGED
|
@@ -57,7 +57,7 @@ export const distance2Point = (x1, y1, x2, y2) => {
|
|
|
57
57
|
const dist = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
|
58
58
|
return Number.isFinite(dist) ? dist : 0;
|
|
59
59
|
};
|
|
60
|
-
import { diffDate } from "./diffDate";
|
|
61
|
-
import { positiveNumber } from "./positiveNumber";
|
|
60
|
+
import { diffDate } from "./diffDate.js";
|
|
61
|
+
import { positiveNumber } from "./positiveNumber.js";
|
|
62
62
|
export { diffDate, positiveNumber };
|
|
63
63
|
//# sourceMappingURL=index.js.map
|
package/esm/name/index.js
CHANGED
package/esm/name/vi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { randomElement } from "../array";
|
|
1
|
+
import { randomElement } from "../array.js";
|
|
2
2
|
//prettier-ignore
|
|
3
3
|
//const FIRST = ['Ân', 'Úc', 'Uất', 'Đàm', 'Đào', 'Đinh', 'Đoàn', 'An', 'Bành', 'Bạch', 'Cao', 'Châu', 'Chử', 'Chu', 'Chung', 'Dữu', 'Diệp', 'Doãn', 'Giang', 'Hà', 'Hàn', 'Kiều', 'Kim', 'Lâm', 'Lương', 'Lưu', 'Lạc', 'Lục', 'La', 'Liễu', 'Mã', 'Mạc', 'Mạch', 'Mai', 'Ngư', 'Nghiêm', 'Phí', 'Phó', 'Phùng', 'Quách', 'Quang', 'Quyền', 'Tô', 'Tôn', 'Tạ', 'Tống', 'Thái', 'Sái', 'Thân', 'Thạch', 'Thảo', 'Thủy', 'Thi', 'Tiêu', 'Trương', 'Trầm', 'Trịnh', 'Trang', 'Triệu', 'Văn', 'Vĩnh', 'Vương', 'Vưu', 'Nguyễn', 'Trần', 'Lê', 'Phạm', 'Huỳnh', 'Hoàng', 'Phan', 'Vũ', 'Võ', 'Đặng', 'Bùi', 'Đỗ', 'Hồ', 'Ngô', 'Dương', 'Lý', 'Nguyễn', 'Trần', 'Lê', 'Phạm', 'Huỳnh', 'Hoàng', 'Phan', 'Vũ', 'Võ', 'Đặng', 'Bùi', 'Đỗ', 'Hồ', 'Ngô', 'Dương', 'Lý', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Nguyễn', 'Trần', 'Lê', 'Phạm', 'Huỳnh', 'Hoàng', 'Phan', 'Vũ', 'Võ', 'Đặng', 'Bùi', 'Đỗ', 'Hồ', 'Ngô', 'Dương', 'Lý', 'Nguyễn', 'Trần', 'Lê', 'Phạm', 'Huỳnh', 'Hoàng', 'Phan', 'Vũ', 'Võ', 'Đặng', 'Bùi', 'Đỗ', 'Hồ', 'Ngô', 'Dương', 'Lý',];
|
|
4
4
|
//prettier-ignore
|
package/esm/object/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* Object utility functions
|
|
3
3
|
* @module object
|
|
4
4
|
*/
|
|
5
|
-
export { isNull } from "./isNull";
|
|
6
|
-
export { isEmpty } from "./isEmpty";
|
|
7
|
-
export { toBool } from "./toBool";
|
|
8
|
-
export { toInt } from "./toInt";
|
|
9
|
-
export { toFloat } from "./toFloat";
|
|
10
|
-
export { toArray } from "./toArray";
|
|
11
|
-
export { toObject } from "./toObject";
|
|
12
|
-
export { iterate } from "./iterate";
|
|
13
|
-
export { isObject } from "./isObject";
|
|
14
|
-
export { isEqual } from "./isEqual";
|
|
15
|
-
export { deepClone } from "./deepClone";
|
|
16
|
-
export { pick } from "./pick";
|
|
17
|
-
export { omit } from "./omit";
|
|
18
|
-
export { merge } from "./merge";
|
|
5
|
+
export { isNull } from "./isNull.js";
|
|
6
|
+
export { isEmpty } from "./isEmpty.js";
|
|
7
|
+
export { toBool } from "./toBool.js";
|
|
8
|
+
export { toInt } from "./toInt.js";
|
|
9
|
+
export { toFloat } from "./toFloat.js";
|
|
10
|
+
export { toArray } from "./toArray.js";
|
|
11
|
+
export { toObject } from "./toObject.js";
|
|
12
|
+
export { iterate } from "./iterate.js";
|
|
13
|
+
export { isObject } from "./isObject.js";
|
|
14
|
+
export { isEqual } from "./isEqual.js";
|
|
15
|
+
export { deepClone } from "./deepClone.js";
|
|
16
|
+
export { pick } from "./pick.js";
|
|
17
|
+
export { omit } from "./omit.js";
|
|
18
|
+
export { merge } from "./merge.js";
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/esm/object/isEqual.js
CHANGED
package/esm/object/merge.js
CHANGED
package/esm/object/toArray.js
CHANGED
package/esm/object/toBool.js
CHANGED
package/esm/object/toFloat.js
CHANGED
package/esm/object/toInt.js
CHANGED
package/esm/package.json
ADDED
package/esm/permission/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requestCamera } from "./requestCamera";
|
|
2
|
-
import { requestDeviceOrientationControl } from "./requestDeviceOrientationControl";
|
|
1
|
+
import { requestCamera } from "./requestCamera.js";
|
|
2
|
+
import { requestDeviceOrientationControl } from "./requestDeviceOrientationControl.js";
|
|
3
3
|
const permission = { requestCamera, requestDeviceOrientationControl };
|
|
4
4
|
export default permission;
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/esm/response/index.js
CHANGED
package/esm/string/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNull } from "../object";
|
|
1
|
+
import { isNull } from "../object.js";
|
|
2
2
|
//prettier-ignore
|
|
3
3
|
const char_map = { À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", Æ: "AE", Ç: "C", È: "E", É: "E", Ê: "E", Ë: "E", Ì: "I", Í: "I", Î: "I", Ï: "I", Ð: "D", Ñ: "N", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ő: "O", Ø: "O", Ù: "U", Ú: "U", Û: "U", Ű: "U", Ý: "Y", Þ: "TH", ß: "ss", à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", æ: "ae", è: "e", é: "e", ê: "e", ë: "e", ì: "i", í: "i", î: "i", ï: "i", ð: "d", ñ: "n", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ő: "o", ø: "o", ù: "u", ú: "u", û: "u", ű: "u", ý: "y", þ: "th", ÿ: "y", "©": "(c)", Γ: "G", Δ: "D", Θ: "8", Λ: "L", Ξ: "3", Π: "P", Σ: "S", Φ: "F", Ψ: "PS", Ω: "W", Ά: "A", Έ: "E", Ί: "I", Ό: "O", Ύ: "Y", Ή: "H", Ώ: "W", Ϊ: "I", Ϋ: "Y", β: "b", "γ": "y", δ: "d", ε: "e", ζ: "z", η: "h", θ: "8", ι: "i", κ: "k", λ: "l", μ: "m", ν: "n", ξ: "3", ο: "o", π: "p", ρ: "r", σ: "s", τ: "t", υ: "y", φ: "f", χ: "x", ψ: "ps", ω: "w", ά: "a", έ: "e", ί: "i", ό: "o", ύ: "y", ή: "h", ώ: "w", ς: "s", ϊ: "i", ΰ: "y", ϋ: "y", ΐ: "i", Ş: "S", İ: "I", Ü: "U", Ğ: "G", ş: "s", ı: "i", ç: "c", ü: "u", ğ: "g", А: "A", Б: "B", В: "V", Г: "G", Д: "D", Е: "E", Ё: "Yo", Ж: "Zh", З: "Z", И: "I", Й: "J", К: "K", Л: "L", М: "M", Н: "N", О: "O", П: "P", Р: "R", С: "S", Т: "T", У: "U", Ф: "F", Х: "H", Ц: "C", Ч: "Ch", Ш: "Sh", Щ: "Sh", Ъ: "", Ы: "Y", Ь: "", Э: "E", Ю: "Yu", Я: "Ya", а: "a", б: "b", в: "v", г: "g", д: "d", е: "e", ё: "yo", ж: "zh", з: "z", и: "i", й: "j", к: "k", л: "l", м: "m", н: "n", о: "o", п: "p", р: "r", с: "s", т: "t", у: "u", ф: "f", х: "h", ц: "c", ч: "ch", ш: "sh", щ: "sh", ъ: "", ы: "y", ь: "", э: "e", ю: "yu", я: "ya", Є: "Ye", І: "I", Ї: "Yi", Ґ: "G", є: "ye", і: "i", ї: "yi", ґ: "g", Č: "C", Ď: "D", Ě: "E", Ň: "N", Ř: "R", Š: "S", Ť: "T", Ů: "U", Ž: "Z", č: "c", ď: "d", ě: "e", ň: "n", ř: "r", š: "s", ť: "t", ů: "u", ž: "z", Ą: "A", Ć: "C", Ę: "e", Ł: "L", Ń: "N", Ś: "S", Ź: "Z", Ż: "Z", ą: "a", ć: "c", ę: "e", ł: "l", ń: "n", ś: "s", ź: "z", ż: "z", Ā: "A", Ē: "E", Ģ: "G", Ī: "i", Ķ: "k", Ļ: "L", Ņ: "N", Ū: "u", ā: "a", ē: "e", ģ: "g", ī: "i", ķ: "k", ļ: "l", ņ: "n", ū: "u" };
|
|
4
4
|
/**
|
|
@@ -116,15 +116,15 @@ export const clearUnicodeCharacters = (s, opt = {}) => {
|
|
|
116
116
|
s = s.replace(RegExp("(^" + opt.delimiter + "|" + opt.delimiter + "$)", "g"), "");
|
|
117
117
|
return opt.lowercase ? s.toLowerCase() : s;
|
|
118
118
|
};
|
|
119
|
-
import { makeDaySlug } from "./makeDaySlug";
|
|
120
|
-
import { generateUUID } from "./generateUUID";
|
|
121
|
-
import { randAllCharacterByLength, randomStringByLength, randomStringAndNumberByLength, uniqueSortByTime, randomFileName, } from "./random";
|
|
122
|
-
import { formatNumber } from "./formatNumber";
|
|
123
|
-
import { generatePassword } from "./generatePassword";
|
|
124
|
-
import { trimNull } from "./trimNull";
|
|
125
|
-
import guessMimeTypeByBuffer from "./guessMimeTypeByBuffer";
|
|
126
|
-
import padNumberWithLeadingZeros from "./padNumberWithLeadingZeros";
|
|
127
|
-
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, getExtensionFromMimeType, isImage, isImageByMimeType, isVideoByMimeType, } from "./url";
|
|
128
|
-
export { toBase62, fromBase62, toBase62Big, fromBase62Big } from "./base62";
|
|
119
|
+
import { makeDaySlug } from "./makeDaySlug.js";
|
|
120
|
+
import { generateUUID } from "./generateUUID.js";
|
|
121
|
+
import { randAllCharacterByLength, randomStringByLength, randomStringAndNumberByLength, uniqueSortByTime, randomFileName, } from "./random.js";
|
|
122
|
+
import { formatNumber } from "./formatNumber.js";
|
|
123
|
+
import { generatePassword } from "./generatePassword.js";
|
|
124
|
+
import { trimNull } from "./trimNull.js";
|
|
125
|
+
import guessMimeTypeByBuffer from "./guessMimeTypeByBuffer.js";
|
|
126
|
+
import padNumberWithLeadingZeros from "./padNumberWithLeadingZeros.js";
|
|
127
|
+
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, getExtensionFromMimeType, isImage, isImageByMimeType, isVideoByMimeType, } from "./url.js";
|
|
128
|
+
export { toBase62, fromBase62, toBase62Big, fromBase62Big } from "./base62.js";
|
|
129
129
|
export { makeDaySlug, guessMimeTypeByBuffer, generateUUID, randAllCharacterByLength, randomStringByLength, randomStringAndNumberByLength, uniqueSortByTime, randomFileName, formatNumber, generatePassword, trimNull, addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, getExtensionFromMimeType, isImage, isImageByMimeType, isVideoByMimeType, padNumberWithLeadingZeros, };
|
|
130
130
|
//# sourceMappingURL=index.js.map
|
package/esm/string/makeSlug.js
CHANGED
package/esm/string/trimNull.js
CHANGED
package/esm/xconsole/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export const removeConsole = disableConsole;
|
|
|
8
8
|
export const showCredit = (version) => {
|
|
9
9
|
console.log(`${version ? `Version: ${version} | ` : ""}Developed by Digitop | https://www.wearetopgroup.com/?utm_src=console`);
|
|
10
10
|
};
|
|
11
|
-
import { enableConsole } from "./enableConsole";
|
|
11
|
+
import { enableConsole } from "./enableConsole.js";
|
|
12
12
|
const xconsole = { enableConsole, disableConsole, removeConsole, showCredit };
|
|
13
13
|
export default xconsole;
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diginext-utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.27",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"homepage": "https://wearetopgroup.com",
|
|
@@ -18,47 +18,218 @@
|
|
|
18
18
|
"extra"
|
|
19
19
|
],
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
|
+
"module": "./esm/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
"*": [
|
|
26
|
+
"./dist/index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"array": [
|
|
29
|
+
"./dist/array/index.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"string": [
|
|
32
|
+
"./dist/string/index.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"object": [
|
|
35
|
+
"./dist/object/index.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"math": [
|
|
38
|
+
"./dist/math/index.d.ts"
|
|
39
|
+
],
|
|
40
|
+
"file": [
|
|
41
|
+
"./dist/file/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"device": [
|
|
44
|
+
"./dist/device/index.d.ts"
|
|
45
|
+
],
|
|
46
|
+
"date": [
|
|
47
|
+
"./dist/date/index.d.ts"
|
|
48
|
+
],
|
|
49
|
+
"email": [
|
|
50
|
+
"./dist/email/index.d.ts"
|
|
51
|
+
],
|
|
52
|
+
"gameboi": [
|
|
53
|
+
"./dist/gameboi/index.d.ts"
|
|
54
|
+
],
|
|
55
|
+
"images": [
|
|
56
|
+
"./dist/images/index.d.ts"
|
|
57
|
+
],
|
|
58
|
+
"name": [
|
|
59
|
+
"./dist/name/index.d.ts"
|
|
60
|
+
],
|
|
61
|
+
"permission": [
|
|
62
|
+
"./dist/permission/index.d.ts"
|
|
63
|
+
],
|
|
64
|
+
"response": [
|
|
65
|
+
"./dist/response/index.d.ts"
|
|
66
|
+
],
|
|
67
|
+
"xconsole": [
|
|
68
|
+
"./dist/xconsole/index.d.ts"
|
|
69
|
+
],
|
|
70
|
+
"cached": [
|
|
71
|
+
"./dist/cached/index.d.ts"
|
|
72
|
+
],
|
|
73
|
+
"html": [
|
|
74
|
+
"./dist/html/index.d.ts"
|
|
75
|
+
],
|
|
76
|
+
"lib": [
|
|
77
|
+
"./dist/lib/index.d.ts"
|
|
78
|
+
],
|
|
79
|
+
"makeSlug": [
|
|
80
|
+
"./dist/Slug.d.ts"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"exports": {
|
|
85
|
+
".": {
|
|
86
|
+
"types": "./dist/index.d.ts",
|
|
87
|
+
"import": "./esm/index.js",
|
|
88
|
+
"require": "./dist/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./array": {
|
|
91
|
+
"types": "./dist/array/index.d.ts",
|
|
92
|
+
"import": "./esm/array/index.js",
|
|
93
|
+
"require": "./dist/array/index.js"
|
|
94
|
+
},
|
|
95
|
+
"./makeSlug": {
|
|
96
|
+
"types": "./dist/Slug.d.ts",
|
|
97
|
+
"import": "./esm/Slug.js",
|
|
98
|
+
"require": "./dist/Slug.js"
|
|
99
|
+
},
|
|
100
|
+
"./string": {
|
|
101
|
+
"types": "./dist/string/index.d.ts",
|
|
102
|
+
"import": "./esm/string/index.js",
|
|
103
|
+
"require": "./dist/string/index.js"
|
|
104
|
+
},
|
|
105
|
+
"./guessMimeType": {
|
|
106
|
+
"types": "./dist/string/guessMimeType.d.ts",
|
|
107
|
+
"import": "./esm/string/guessMimeType.js",
|
|
108
|
+
"require": "./dist/string/guessMimeType.js"
|
|
109
|
+
},
|
|
110
|
+
"./object": {
|
|
111
|
+
"types": "./dist/object/index.d.ts",
|
|
112
|
+
"import": "./esm/object/index.js",
|
|
113
|
+
"require": "./dist/object/index.js"
|
|
114
|
+
},
|
|
115
|
+
"./math": {
|
|
116
|
+
"types": "./dist/math/index.d.ts",
|
|
117
|
+
"import": "./esm/math/index.js",
|
|
118
|
+
"require": "./dist/math/index.js"
|
|
119
|
+
},
|
|
120
|
+
"./file": {
|
|
121
|
+
"types": "./dist/file/index.d.ts",
|
|
122
|
+
"import": "./esm/file/index.js",
|
|
123
|
+
"require": "./dist/file/index.js"
|
|
124
|
+
},
|
|
125
|
+
"./device": {
|
|
126
|
+
"types": "./dist/device/index.d.ts",
|
|
127
|
+
"import": "./esm/device/index.js",
|
|
128
|
+
"require": "./dist/device/index.js"
|
|
129
|
+
},
|
|
130
|
+
"./date": {
|
|
131
|
+
"types": "./dist/date/index.d.ts",
|
|
132
|
+
"import": "./esm/date/index.js",
|
|
133
|
+
"require": "./dist/date/index.js"
|
|
134
|
+
},
|
|
135
|
+
"./email": {
|
|
136
|
+
"types": "./dist/email/index.d.ts",
|
|
137
|
+
"import": "./esm/email/index.js",
|
|
138
|
+
"require": "./dist/email/index.js"
|
|
139
|
+
},
|
|
140
|
+
"./gameboi": {
|
|
141
|
+
"types": "./dist/gameboi/index.d.ts",
|
|
142
|
+
"import": "./esm/gameboi/index.js",
|
|
143
|
+
"require": "./dist/gameboi/index.js"
|
|
144
|
+
},
|
|
145
|
+
"./images": {
|
|
146
|
+
"types": "./dist/images/index.d.ts",
|
|
147
|
+
"import": "./esm/images/index.js",
|
|
148
|
+
"require": "./dist/images/index.js"
|
|
149
|
+
},
|
|
150
|
+
"./name": {
|
|
151
|
+
"types": "./dist/name/index.d.ts",
|
|
152
|
+
"import": "./esm/name/index.js",
|
|
153
|
+
"require": "./dist/name/index.js"
|
|
154
|
+
},
|
|
155
|
+
"./permission": {
|
|
156
|
+
"types": "./dist/permission/index.d.ts",
|
|
157
|
+
"import": "./esm/permission/index.js",
|
|
158
|
+
"require": "./dist/permission/index.js"
|
|
159
|
+
},
|
|
160
|
+
"./response": {
|
|
161
|
+
"types": "./dist/response/index.d.ts",
|
|
162
|
+
"import": "./esm/response/index.js",
|
|
163
|
+
"require": "./dist/response/index.js"
|
|
164
|
+
},
|
|
165
|
+
"./xconsole": {
|
|
166
|
+
"types": "./dist/xconsole/index.d.ts",
|
|
167
|
+
"import": "./esm/xconsole/index.js",
|
|
168
|
+
"require": "./dist/xconsole/index.js"
|
|
169
|
+
},
|
|
170
|
+
"./cached": {
|
|
171
|
+
"types": "./dist/cached/index.d.ts",
|
|
172
|
+
"import": "./esm/cached/index.js",
|
|
173
|
+
"require": "./dist/cached/index.js"
|
|
174
|
+
},
|
|
175
|
+
"./html": {
|
|
176
|
+
"types": "./dist/html/index.d.ts",
|
|
177
|
+
"import": "./esm/html/index.js",
|
|
178
|
+
"require": "./dist/html/index.js"
|
|
179
|
+
},
|
|
180
|
+
"./lib": {
|
|
181
|
+
"types": "./dist/lib/index.d.ts",
|
|
182
|
+
"import": "./esm/lib/index.js",
|
|
183
|
+
"require": "./dist/lib/index.js"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
21
186
|
"files": [
|
|
22
187
|
"dist",
|
|
23
188
|
"esm"
|
|
24
189
|
],
|
|
25
190
|
"scripts": {
|
|
26
|
-
"build": "npm run clean &&
|
|
27
|
-
"
|
|
191
|
+
"build": "npm run clean && npm run build:cjs && npm run build:esm && npm run postbuild",
|
|
192
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
193
|
+
"build:esm": "tsc -p tsconfig.esm.json && node scripts/fix-esm-imports.js",
|
|
194
|
+
"postbuild": "node -e \"require('fs').writeFileSync('esm/package.json', JSON.stringify({type:'module'}, null, 2))\"",
|
|
195
|
+
"dev": "tsc -p tsconfig.cjs.json --watch",
|
|
28
196
|
"clean": "rimraf dist esm",
|
|
29
197
|
"release": "npm run build && npm publish",
|
|
30
|
-
"test": "
|
|
31
|
-
"
|
|
198
|
+
"test": "vitest run",
|
|
199
|
+
"test:watch": "vitest",
|
|
200
|
+
"test:coverage": "vitest run --coverage",
|
|
201
|
+
"lint": "eslint src --fix --ext .ts,.tsx",
|
|
202
|
+
"typecheck": "tsc --noEmit"
|
|
32
203
|
},
|
|
33
204
|
"dependencies": {
|
|
34
|
-
"blueimp-load-image": "
|
|
205
|
+
"blueimp-load-image": "5.16.0",
|
|
35
206
|
"chalk": "4.1.2",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"lodash": "^4.17.21"
|
|
207
|
+
"dayjs": "1.11.5",
|
|
208
|
+
"deep-email-validator": "0.1.21",
|
|
209
|
+
"file-saver": "2.0.5",
|
|
210
|
+
"gsap": "3.10.4",
|
|
211
|
+
"lodash": "4.17.21"
|
|
42
212
|
},
|
|
43
213
|
"publishConfig": {
|
|
44
214
|
"access": "public"
|
|
45
215
|
},
|
|
46
216
|
"devDependencies": {
|
|
47
|
-
"@types/blueimp-load-image": "
|
|
48
|
-
"@types/file-saver": "
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/react": "
|
|
53
|
-
"@
|
|
54
|
-
"eslint": "
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"typescript": "
|
|
217
|
+
"@types/blueimp-load-image": "5.16.0",
|
|
218
|
+
"@types/file-saver": "2.0.5",
|
|
219
|
+
"@types/lodash": "4.14.186",
|
|
220
|
+
"@types/node": "20.15.0",
|
|
221
|
+
"@types/react": "17.0.13",
|
|
222
|
+
"@types/react-dom": "17.0.8",
|
|
223
|
+
"@typescript-eslint/eslint-plugin": "6.0.0",
|
|
224
|
+
"@typescript-eslint/parser": "6.0.0",
|
|
225
|
+
"@vitest/coverage-v8": "1.0.0",
|
|
226
|
+
"eslint": "8.50.0",
|
|
227
|
+
"eslint-config-prettier": "9.0.0",
|
|
228
|
+
"eslint-plugin-import": "2.29.0",
|
|
229
|
+
"prettier": "3.0.0",
|
|
230
|
+
"rimraf": "5.0.1",
|
|
231
|
+
"typescript": "5.9.3",
|
|
232
|
+
"vitest": "1.0.0"
|
|
62
233
|
},
|
|
63
234
|
"nodemonConfig": {
|
|
64
235
|
"watch": [
|