diginext-utils 4.0.26 → 4.0.28

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.
Files changed (51) hide show
  1. package/dist/images/downloadByUrl.d.ts.map +1 -1
  2. package/dist/images/downloadByUrl.js +8 -6
  3. package/dist/images/downloadByUrl.js.map +1 -1
  4. package/esm/array/average.js +1 -1
  5. package/esm/array/index.js +22 -22
  6. package/esm/array/randomElement.js +1 -1
  7. package/esm/array.js +1 -1
  8. package/esm/cached/CacheManager.js +1 -1
  9. package/esm/cached/index.js +1 -1
  10. package/esm/date/index.js +2 -2
  11. package/esm/device/camera.js +1 -1
  12. package/esm/email/index.js +1 -1
  13. package/esm/file/detectPrivateKey.js +2 -2
  14. package/esm/file/detectPrivateKeyByFilePath.js +1 -1
  15. package/esm/file/index.js +7 -7
  16. package/esm/html/index.js +1 -1
  17. package/esm/images/downloadByUrl.d.ts.map +1 -1
  18. package/esm/images/downloadByUrl.js +11 -9
  19. package/esm/images/downloadByUrl.js.map +1 -1
  20. package/esm/images/index.js +4 -4
  21. package/esm/images/loadImageAsBlobUrl.js +1 -1
  22. package/esm/images/upload.js +3 -3
  23. package/esm/index.js +36 -36
  24. package/esm/lib/index.js +1 -1
  25. package/esm/math/index.js +2 -2
  26. package/esm/math/positiveNumber.js +1 -1
  27. package/esm/name/index.js +2 -2
  28. package/esm/name/vi.js +1 -1
  29. package/esm/object/index.js +14 -14
  30. package/esm/object/isEqual.js +1 -1
  31. package/esm/object/merge.js +1 -1
  32. package/esm/object/toArray.js +1 -1
  33. package/esm/object/toBool.js +2 -2
  34. package/esm/object/toFloat.js +1 -1
  35. package/esm/object/toInt.js +1 -1
  36. package/esm/package.json +3 -0
  37. package/esm/permission/index.js +2 -2
  38. package/esm/permission/requestDeviceOrientationControl.js +1 -1
  39. package/esm/response/index.js +1 -1
  40. package/esm/string/convertPathnameAndQuery.js +1 -1
  41. package/esm/string/formatNumber.js +1 -1
  42. package/esm/string/generatePassword.js +1 -1
  43. package/esm/string/getIntFromNextJsRouter.js +1 -1
  44. package/esm/string/getStringFromNextJsRouter.js +1 -1
  45. package/esm/string/getTextBetweenCharByIndex.js +1 -1
  46. package/esm/string/index.js +11 -11
  47. package/esm/string/makeSlug.js +1 -1
  48. package/esm/string/trimNull.js +1 -1
  49. package/esm/xconsole/enableConsole.js +1 -1
  50. package/esm/xconsole/index.js +1 -1
  51. package/package.json +198 -27
@@ -1 +1 @@
1
- {"version":3,"file":"downloadByUrl.d.ts","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,EAAE,OAAO;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;cAexE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAkBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAmC/D,CAAC;AAEF,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,oBAO5E;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"downloadByUrl.d.ts","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,EAAE,OAAO;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;cAexE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAkBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAqC/D,CAAC;AAEF,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,oBAO5E;AAED,eAAe,aAAa,CAAC"}
@@ -53,12 +53,14 @@ const doSaveFileDesktop = (url, data) => __awaiter(void 0, void 0, void 0, funct
53
53
  exports.doSaveFileDesktop = doSaveFileDesktop;
54
54
  const doSaveFileMobile = (url, data) => __awaiter(void 0, void 0, void 0, function* () {
55
55
  return new Promise((resolve, _reject) => __awaiter(void 0, void 0, void 0, function* () {
56
- const link = document.createElement("a");
57
- link.href = url;
58
- link.download = (data === null || data === void 0 ? void 0 : data.filename) || (0, url_1.getFileNameWithExtension)(url); // Set the download attribute with a filename
59
- document.body.appendChild(link);
60
- link.click();
61
- document.body.removeChild(link);
56
+ if ((0, index_1.isAndroid)()) {
57
+ const link = document.createElement("a");
58
+ link.href = url;
59
+ link.download = (data === null || data === void 0 ? void 0 : data.filename) || (0, url_1.getFileNameWithExtension)(url); // Set the download attribute with a filename
60
+ document.body.appendChild(link);
61
+ link.click();
62
+ document.body.removeChild(link);
63
+ }
62
64
  const __data = yield (0, exports.doGetFile)(url, data);
63
65
  const file = __data === null || __data === void 0 ? void 0 : __data.file;
64
66
  const filename = __data === null || __data === void 0 ? void 0 : __data.filename;
@@ -1 +1 @@
1
- {"version":3,"file":"downloadByUrl.js","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoFA,sCAOC;AA3FD,4DAAgC;AAChC,2CAA2C;AAC3C,6CAAkD;AAClD,uCAAmF;AAO5E,MAAM,SAAS,GAAG,CAAO,GAAW,EAAE,IAA4B,EAAE,EAAE;IAC5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,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AAC,KAAK,CAAC,CAAC;QAE9C,SAAS;aACP,KAAK,CAAC;YACN,KAAK,EAAE,CAAC,IAAI,CAAC;YACb,KAAK,EAAE,QAAQ;SACf,CAAC;aACD,IAAI,CAAC,GAAG,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,CAAC;YACd,YAAY;YACZ,kBAAkB;QACnB,CAAC,CAAC;aACD,KAAK,CAAC,CAAO,GAAG,EAAE,EAAE;;YACpB,IAAI,MAAA,MAAA,GAAG,GAAG,EAAE,EAAC,QAAQ,mDAAG,YAAY,CAAC;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,MAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,QAAQ,mDAAG,cAAc,CAAC;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpE,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YAEtC,MAAM,IAAA,yBAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAEnC,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACJ,CAAC,CAAA,CAAC;AArCW,QAAA,gBAAgB,oBAqC3B;AAEF,SAAsB,aAAa,CAAC,GAAW,EAAE,IAA4B;;QAC5E,EAAE;QACF,IAAI,IAAA,gBAAQ,GAAE,EAAE,CAAC;YAChB,OAAO,IAAA,wBAAgB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,OAAO,IAAA,yBAAiB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CAAA;AAED,kBAAe,aAAa,CAAC"}
@@ -1,4 +1,4 @@
1
- import { sum } from "./sum";
1
+ import { sum } from "./sum.js";
2
2
  /**
3
3
  * Calculates the average (mean) of all elements in an array.
4
4
  * If a key is provided, averages the values of that property from each object.
@@ -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
@@ -1,4 +1,4 @@
1
- import { randomIndex } from "./randomIndex";
1
+ import { randomIndex } from "./randomIndex.js";
2
2
  /**
3
3
  * Returns a random element from an array.
4
4
  *
package/esm/array.js CHANGED
@@ -1,4 +1,4 @@
1
- import { randomInt as randInt } from "./math/randomInt";
1
+ import { randomInt as randInt } from "./math/randomInt.js";
2
2
  export const sumArray = (array, key) => {
3
3
  if (!array) {
4
4
  console.warn("ARRAY NOT EXITED !");
@@ -1,4 +1,4 @@
1
- import formatBytes from "../string/formatBytes";
1
+ import formatBytes from "../string/formatBytes.js";
2
2
  export default class CacheManager {
3
3
  constructor(props) {
4
4
  this.MAX_CACHE_SIZE = 1000;
@@ -2,5 +2,5 @@
2
2
  * Cache management utilities
3
3
  * @module cached
4
4
  */
5
- export { default as CacheManager } from "./CacheManager";
5
+ export { default as CacheManager } from "./CacheManager.js";
6
6
  //# sourceMappingURL=index.js.map
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
@@ -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;
@@ -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);
@@ -1,5 +1,5 @@
1
1
  import fs from "fs";
2
- import parseEnvFile from "./parseEnvFile";
2
+ import parseEnvFile from "./parseEnvFile.js";
3
3
  export default function detectPrivateKeyByFilePath(_path) {
4
4
  //
5
5
  if (!fs.existsSync(_path))
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
@@ -2,5 +2,5 @@
2
2
  * HTML utility functions
3
3
  * @module html
4
4
  */
5
- export { default as transform3dToObject } from "./transform3dToObject";
5
+ export { default as transform3dToObject } from "./transform3dToObject.js";
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"downloadByUrl.d.ts","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,EAAE,OAAO;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;cAexE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAkBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAmC/D,CAAC;AAEF,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,oBAO5E;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"downloadByUrl.d.ts","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,EAAE,OAAO;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;cAexE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAkBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,OAAO,KAAK,qBAqC/D,CAAC;AAEF,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,oBAO5E;AAED,eAAe,aAAa,CAAC"}
@@ -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 { isAndroid, 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) {
@@ -44,12 +44,14 @@ export const doSaveFileDesktop = (url, data) => __awaiter(void 0, void 0, void 0
44
44
  });
45
45
  export const doSaveFileMobile = (url, data) => __awaiter(void 0, void 0, void 0, function* () {
46
46
  return new Promise((resolve, _reject) => __awaiter(void 0, void 0, void 0, function* () {
47
- const link = document.createElement("a");
48
- link.href = url;
49
- link.download = (data === null || data === void 0 ? void 0 : data.filename) || getFileNameWithExtension(url); // Set the download attribute with a filename
50
- document.body.appendChild(link);
51
- link.click();
52
- document.body.removeChild(link);
47
+ if (isAndroid()) {
48
+ const link = document.createElement("a");
49
+ link.href = url;
50
+ link.download = (data === null || data === void 0 ? void 0 : data.filename) || getFileNameWithExtension(url); // Set the download attribute with a filename
51
+ document.body.appendChild(link);
52
+ link.click();
53
+ document.body.removeChild(link);
54
+ }
53
55
  const __data = yield doGetFile(url, data);
54
56
  const file = __data === null || __data === void 0 ? void 0 : __data.file;
55
57
  const filename = __data === null || __data === void 0 ? void 0 : __data.filename;
@@ -1 +1 @@
1
- {"version":3,"file":"downloadByUrl.js","sourceRoot":"","sources":["../../src/images/downloadByUrl.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAOnF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAO,GAAW,EAAE,IAA4B,EAAE,EAAE;IAC5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAA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AAC;YACd,YAAY;YACZ,kBAAkB;QACnB,CAAC,CAAC;aACD,KAAK,CAAC,CAAO,GAAG,EAAE,EAAE;;YACpB,IAAI,MAAA,MAAA,GAAG,GAAG,EAAE,EAAC,QAAQ,mDAAG,YAAY,CAAC;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,MAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,QAAQ,mDAAG,cAAc,CAAC;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpE,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YAEtC,MAAM,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAEnC,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,UAAgB,aAAa,CAAC,GAAW,EAAE,IAA4B;;QAC5E,EAAE;QACF,IAAI,QAAQ,EAAE,EAAE,CAAC;YAChB,OAAO,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,OAAO,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;CAAA;AAED,eAAe,aAAa,CAAC"}
@@ -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",
@@ -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
@@ -2,5 +2,5 @@
2
2
  * Library utilities
3
3
  * @module lib
4
4
  */
5
- export { default as batchProcessor } from "./batchProcessor";
5
+ export { default as batchProcessor } from "./batchProcessor.js";
6
6
  //# sourceMappingURL=index.js.map
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
@@ -1,4 +1,4 @@
1
- import { isNull } from "../object";
1
+ import { isNull } from "../object.js";
2
2
  export function positiveNumber(number) {
3
3
  if (isNull(number))
4
4
  return 0;
package/esm/name/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import NameEN from "./en";
2
- import NameVI from "./vi";
1
+ import NameEN from "./en.js";
2
+ import NameVI from "./vi.js";
3
3
  export { NameEN, NameVI };
4
4
  const xname = { NameEN, NameVI };
5
5
  export default xname;
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
@@ -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
@@ -1,4 +1,4 @@
1
- import { isObject } from "./isObject";
1
+ import { isObject } from "./isObject.js";
2
2
  /**
3
3
  * Performs a deep equality comparison between two values.
4
4
  * Recursively compares objects and their nested properties.
@@ -1,4 +1,4 @@
1
- import { isObject } from "./isObject";
1
+ import { isObject } from "./isObject.js";
2
2
  /**
3
3
  * Deeply merges multiple objects into a new object.
4
4
  * Later objects' properties override earlier ones.
@@ -1,4 +1,4 @@
1
- import { isNull } from "./isNull";
1
+ import { isNull } from "./isNull.js";
2
2
  /**
3
3
  * Converts a value to an array.
4
4
  * If the value is already an array, returns it as-is.
@@ -1,5 +1,5 @@
1
- import { isNull } from "./isNull";
2
- import { toFloat } from "./toFloat";
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".
@@ -1,4 +1,4 @@
1
- import { isNull } from "./isNull";
1
+ import { isNull } from "./isNull.js";
2
2
  /**
3
3
  * Converts a value to a floating-point number.
4
4
  * Returns 0 if the value cannot be converted.
@@ -1,4 +1,4 @@
1
- import { isNull } from "./isNull";
1
+ import { isNull } from "./isNull.js";
2
2
  /**
3
3
  * Converts a value to an integer.
4
4
  * Returns 0 if the value cannot be converted.
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -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
@@ -1,4 +1,4 @@
1
- import { isAndroid } from "../device";
1
+ import { isAndroid } from "../device.js";
2
2
  export const requestDeviceOrientationControl = () => {
3
3
  if (typeof window == "undefined")
4
4
  return false;
@@ -1,4 +1,4 @@
1
- import { logRes } from "../xconsole/log";
1
+ import { logRes } from "../xconsole/log.js";
2
2
  export const getResponse = () => {
3
3
  return { status: 0, messages: [], data: null };
4
4
  };
@@ -1,4 +1,4 @@
1
- import { isNull } from "../object";
1
+ import { isNull } from "../object.js";
2
2
  export default function convertPathnameAndQuery(url) {
3
3
  //
4
4
  if (isNull(url))
@@ -1,4 +1,4 @@
1
- import { toInt } from "../object";
1
+ import { toInt } from "../object.js";
2
2
  /**
3
3
  * Format the input number with commas
4
4
  * @example 1000000 -> 1,000,000
@@ -1,4 +1,4 @@
1
- import { numeric, punctuation, randomStringByLength, textLowCase } from "./random";
1
+ import { numeric, punctuation, randomStringByLength, textLowCase } from "./random.js";
2
2
  /**
3
3
  * random password
4
4
  * - if hard = true -> random punctuation inside
@@ -1,4 +1,4 @@
1
- import { isNull, toInt } from "../object";
1
+ import { isNull, toInt } from "../object.js";
2
2
  export default function getIntFromNextJsRouter(query) {
3
3
  //
4
4
  if (isNull(query))
@@ -1,4 +1,4 @@
1
- import { isNull } from "../object";
1
+ import { isNull } from "../object.js";
2
2
  export default function getStringFromNextJsRouter(query) {
3
3
  //
4
4
  if (isNull(query))
@@ -1,4 +1,4 @@
1
- import indexesOf from "./indexesOf";
1
+ import indexesOf from "./indexesOf.js";
2
2
  export default function getTextBetweenCharByIndex(str, char, index) {
3
3
  const arr = indexesOf(str, char);
4
4
  let start = 0, end = 0;
@@ -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
@@ -1,4 +1,4 @@
1
- import { makeSlug } from "../Slug";
1
+ import { makeSlug } from "../Slug.js";
2
2
  export default makeSlug;
3
3
  export { makeSlug };
4
4
  //# sourceMappingURL=makeSlug.js.map
@@ -1,4 +1,4 @@
1
- import trim from "lodash/trim";
1
+ import trim from "lodash/trim.js";
2
2
  export function trimNull(str) {
3
3
  if (!str)
4
4
  return "";
@@ -1,4 +1,4 @@
1
- import cloneDeep from "lodash/cloneDeep";
1
+ import cloneDeep from "lodash/cloneDeep.js";
2
2
  const _console = cloneDeep(console);
3
3
  export function enableConsole() {
4
4
  return _console;
@@ -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.26",
3
+ "version": "4.0.28",
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 && tsc --module commonjs --outDir dist && tsc --module esnext --outDir esm",
27
- "dev": "nodemon tsc --module commonjs --outDir dist",
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": "mocha test/*.test.js",
31
- "lint": "TIMING=1 eslint src --fix"
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": "^5.16.0",
205
+ "blueimp-load-image": "5.16.0",
35
206
  "chalk": "4.1.2",
36
- "concurrently": "^7.2.2",
37
- "dayjs": "^1.11.5",
38
- "deep-email-validator": "^0.1.21",
39
- "file-saver": "^2.0.5",
40
- "gsap": "^3.10.4",
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": "^5.16.0",
48
- "@types/file-saver": "^2.0.5",
49
- "@types/jest": "^26.0.22",
50
- "@types/lodash": "^4.14.186",
51
- "@types/node": "^18.8.5",
52
- "@types/react": "^17.0.13",
53
- "@types/react-dom": "^17.0.8",
54
- "eslint": "^7.16.0",
55
- "eslint-plugin-import": "^2.26.0",
56
- "esm": "^3.2.25",
57
- "mocha": "^10.0.0",
58
- "nodemon": "^3.0.1",
59
- "rimraf": "^5.0.1",
60
- "prettier": "^3.0.0",
61
- "typescript": "^4.5.3"
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": [