diginext-utils 4.0.10 → 4.0.11
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/index.js +1 -1
- package/esm/date/index.js +1 -1
- package/esm/file/detectPrivateKey.js +2 -2
- package/esm/file/detectPrivateKeyByFilePath.js +1 -1
- package/esm/file/index.js +3 -3
- package/esm/html/index.js +1 -1
- 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 +34 -34
- package/esm/lib/index.js +1 -1
- package/esm/math/index.js +12 -12
- package/esm/name/index.js +2 -2
- 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/permission/index.js +2 -2
- package/esm/string/generatePassword.js +1 -1
- package/esm/string/getTextBetweenCharByIndex.js +1 -1
- package/esm/string/index.js +7 -7
- package/esm/xconsole/index.js +1 -1
- package/package.json +1 -1
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
|
|
6
|
-
export { average } from
|
|
7
|
-
export { min } from
|
|
8
|
-
export { max } from
|
|
9
|
-
export { sortByString } from
|
|
10
|
-
export { sortByNumber } from
|
|
11
|
-
export { first } from
|
|
12
|
-
export { last } from
|
|
13
|
-
export { randomIndex } from
|
|
14
|
-
export { randomElement } from
|
|
15
|
-
export { unique } from
|
|
16
|
-
export { intersection } from
|
|
17
|
-
export { removeItem } from
|
|
18
|
-
export { removeItemByKey } from
|
|
19
|
-
export { sample } from
|
|
20
|
-
export { shuffle } from
|
|
21
|
-
export { moveElement } from
|
|
22
|
-
export { chunk } from
|
|
23
|
-
export { compact } from
|
|
24
|
-
export { flatten } from
|
|
25
|
-
export { difference } from
|
|
26
|
-
export { union } from
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import getAllFiles from
|
|
2
|
-
import detectPrivateKeyByFilePath from
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { createDir } from
|
|
2
|
-
import { fileMove } from
|
|
3
|
-
import fileExt from
|
|
1
|
+
import { createDir } from "./createDir.js";
|
|
2
|
+
import { fileMove } from "./fileMove.js";
|
|
3
|
+
import fileExt from "./findFilesByExt.js";
|
|
4
4
|
const xfile = Object.assign({ createDir, fileMove }, fileExt);
|
|
5
5
|
export default xfile;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/esm/html/index.js
CHANGED
package/esm/images/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
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
|
|
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
|
|
11
|
-
import resize from
|
|
12
|
-
import { isImage } from
|
|
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,46 +3,46 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
// Re-export all modules as namespaces
|
|
6
|
-
export * as array from
|
|
7
|
-
export * as object from
|
|
8
|
-
export * as math from
|
|
9
|
-
export * as string from
|
|
10
|
-
export * as file from
|
|
11
|
-
export * as device from
|
|
12
|
-
export * as date from
|
|
13
|
-
export * as email from
|
|
14
|
-
export * as gameboi from
|
|
15
|
-
export * as images from
|
|
16
|
-
export * as name from
|
|
17
|
-
export * as permission from
|
|
18
|
-
export * as response from
|
|
19
|
-
export * as xconsole from
|
|
20
|
-
export * as cached from
|
|
21
|
-
export * as html from
|
|
22
|
-
export * as lib from
|
|
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
23
|
// For tree-shaking, users can import directly from subpaths:
|
|
24
24
|
// import { sum, average } from 'diginext-utils/array'
|
|
25
25
|
// import { isNull, toBool } from 'diginext-utils/object'
|
|
26
26
|
// import { randomInt, clamp } from 'diginext-utils/math'
|
|
27
27
|
// Backward compatibility - default export
|
|
28
28
|
// Note: This uses dynamic imports which may not work in all environments
|
|
29
|
-
import * as arrayModule from
|
|
30
|
-
import * as objectModule from
|
|
31
|
-
import * as mathModule from
|
|
32
|
-
import * as stringModule from
|
|
33
|
-
import * as fileModule from
|
|
34
|
-
import * as deviceModule from
|
|
35
|
-
import * as dateModule from
|
|
36
|
-
import * as emailModule from
|
|
37
|
-
import * as gameboiModule from
|
|
38
|
-
import * as imagesModule from
|
|
39
|
-
import * as nameModule from
|
|
40
|
-
import * as permissionModule from
|
|
41
|
-
import * as responseModule from
|
|
42
|
-
import * as xconsoleModule from
|
|
43
|
-
import * as cachedModule from
|
|
44
|
-
import * as htmlModule from
|
|
45
|
-
import * as libModule from
|
|
29
|
+
import * as arrayModule from "./array.js";
|
|
30
|
+
import * as objectModule from "./object.js";
|
|
31
|
+
import * as mathModule from "./math.js";
|
|
32
|
+
import * as stringModule from "./string.js";
|
|
33
|
+
import * as fileModule from "./file.js";
|
|
34
|
+
import * as deviceModule from "./device.js";
|
|
35
|
+
import * as dateModule from "./date.js";
|
|
36
|
+
import * as emailModule from "./email.js";
|
|
37
|
+
import * as gameboiModule from "./gameboi.js";
|
|
38
|
+
import * as imagesModule from "./images.js";
|
|
39
|
+
import * as nameModule from "./name.js";
|
|
40
|
+
import * as permissionModule from "./permission.js";
|
|
41
|
+
import * as responseModule from "./response.js";
|
|
42
|
+
import * as xconsoleModule from "./xconsole.js";
|
|
43
|
+
import * as cachedModule from "./cached.js";
|
|
44
|
+
import * as htmlModule from "./html.js";
|
|
45
|
+
import * as libModule from "./lib.js";
|
|
46
46
|
/**
|
|
47
47
|
* Default export maintaining backward compatibility
|
|
48
48
|
* @deprecated Use named exports instead for better tree-shaking
|
package/esm/lib/index.js
CHANGED
package/esm/math/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* Math utility functions
|
|
3
3
|
* @module math
|
|
4
4
|
*/
|
|
5
|
-
export { random } from
|
|
6
|
-
export { randomInt } from
|
|
7
|
-
export { randomFloat } from
|
|
8
|
-
export { clamp } from
|
|
9
|
-
export { degToRad } from
|
|
10
|
-
export { radToDeg } from
|
|
11
|
-
export { distance } from
|
|
12
|
-
export { angleBetweenPoints } from
|
|
13
|
-
export { lerp } from
|
|
14
|
-
export { round } from
|
|
15
|
-
export { positiveNumber } from
|
|
16
|
-
export { diffDate } from
|
|
5
|
+
export { random } from "./random.js";
|
|
6
|
+
export { randomInt } from "./randomInt.js";
|
|
7
|
+
export { randomFloat } from "./randomFloat.js";
|
|
8
|
+
export { clamp } from "./clamp.js";
|
|
9
|
+
export { degToRad } from "./degToRad.js";
|
|
10
|
+
export { radToDeg } from "./radToDeg.js";
|
|
11
|
+
export { distance } from "./distance.js";
|
|
12
|
+
export { angleBetweenPoints } from "./angleBetweenPoints.js";
|
|
13
|
+
export { lerp } from "./lerp.js";
|
|
14
|
+
export { round } from "./round.js";
|
|
15
|
+
export { positiveNumber } from "./positiveNumber.js";
|
|
16
|
+
export { diffDate } from "./diffDate.js";
|
|
17
17
|
/**
|
|
18
18
|
* Constant: Degrees to radians conversion factor
|
|
19
19
|
*/
|
package/esm/name/index.js
CHANGED
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
|
|
6
|
-
export { isEmpty } from
|
|
7
|
-
export { toBool } from
|
|
8
|
-
export { toInt } from
|
|
9
|
-
export { toFloat } from
|
|
10
|
-
export { toArray } from
|
|
11
|
-
export { toObject } from
|
|
12
|
-
export { iterate } from
|
|
13
|
-
export { isObject } from
|
|
14
|
-
export { isEqual } from
|
|
15
|
-
export { deepClone } from
|
|
16
|
-
export { pick } from
|
|
17
|
-
export { omit } from
|
|
18
|
-
export { merge } from
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isNull } from
|
|
2
|
-
import { toFloat } from
|
|
1
|
+
import { isNull } from "./isNull.js";
|
|
2
|
+
import { toFloat } from "./toFloat.js";
|
|
3
3
|
/**
|
|
4
4
|
* Converts a value to a boolean.
|
|
5
5
|
* Recognizes string representations like "true", "false", "0", "1".
|
package/esm/object/toFloat.js
CHANGED
package/esm/object/toInt.js
CHANGED
package/esm/permission/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requestCamera } from
|
|
2
|
-
import { requestDeviceOrientationControl } from
|
|
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/string/index.js
CHANGED
|
@@ -116,13 +116,13 @@ 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
|
|
120
|
-
import { generateUUID } from
|
|
121
|
-
import { randAllCharacterByLength, randomStringByLength } from
|
|
122
|
-
import { formatNumber } from
|
|
123
|
-
import { generatePassword } from
|
|
124
|
-
import { trimNull } from
|
|
125
|
-
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage } from
|
|
119
|
+
import { makeDaySlug } from "./makeDaySlug.js";
|
|
120
|
+
import { generateUUID } from "./generateUUID.js";
|
|
121
|
+
import { randAllCharacterByLength, randomStringByLength } from "./random.js";
|
|
122
|
+
import { formatNumber } from "./formatNumber.js";
|
|
123
|
+
import { generatePassword } from "./generatePassword.js";
|
|
124
|
+
import { trimNull } from "./trimNull.js";
|
|
125
|
+
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage } from "./url.js";
|
|
126
126
|
const xstring = {
|
|
127
127
|
getBetween,
|
|
128
128
|
makeString,
|
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
|
|
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
|