diginext-utils 2.1.22 → 2.1.23

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 (112) hide show
  1. package/README.md +162 -162
  2. package/dist/Checker.mjs +29 -0
  3. package/dist/EventDispatcher.mjs +54 -0
  4. package/dist/FileUpload.mjs +62 -0
  5. package/dist/Slug.mjs +9 -0
  6. package/dist/Timer-7b0c4e7c.d.ts +11 -0
  7. package/dist/Timer.mjs +7 -0
  8. package/dist/Validation.mjs +35 -0
  9. package/dist/array-c38eff4c.d.ts +158 -0
  10. package/dist/array.mjs +49 -0
  11. package/dist/browser-8d042ffe.d.ts +22 -0
  12. package/dist/camera-1a859d72.d.ts +15 -0
  13. package/dist/chunk-24DHBJAC.mjs +35 -0
  14. package/dist/chunk-32BJ2V3H.mjs +195 -0
  15. package/dist/chunk-32PJ3FML.mjs +57 -0
  16. package/dist/chunk-3OYOTSDB.mjs +339 -0
  17. package/dist/chunk-4CWVMQ53.mjs +167 -0
  18. package/dist/chunk-4VQ25N7H.mjs +43 -0
  19. package/dist/chunk-6OZHYD5H.mjs +91 -0
  20. package/dist/chunk-76AY2CWV.mjs +22 -0
  21. package/dist/chunk-7MK72U4O.mjs +19 -0
  22. package/dist/chunk-7SOQVGCL.mjs +12 -0
  23. package/dist/chunk-7XKT3AQX.mjs +17 -0
  24. package/dist/chunk-AT5ZUBQL.mjs +151 -0
  25. package/dist/chunk-CKILLYAP.mjs +16 -0
  26. package/dist/chunk-D5JDP7JB.mjs +56 -0
  27. package/dist/chunk-DEOVENCJ.mjs +15 -0
  28. package/dist/chunk-FILFH56Y.mjs +21 -0
  29. package/dist/chunk-FTXB3IBS.mjs +20 -0
  30. package/dist/chunk-GJMNV2OC.mjs +35 -0
  31. package/dist/chunk-GNJDIUYM.mjs +40 -0
  32. package/dist/chunk-HN4EHJ2H.mjs +39 -0
  33. package/dist/chunk-HTAKHCLC.mjs +43 -0
  34. package/dist/chunk-JAP2EUEW.mjs +86 -0
  35. package/dist/chunk-JFASFX5Y.mjs +16 -0
  36. package/dist/chunk-JIMOWRMS.mjs +118 -0
  37. package/dist/chunk-K4KENOE6.mjs +20 -0
  38. package/dist/chunk-LGBBKRBU.mjs +40 -0
  39. package/dist/chunk-PMJLVOEM.mjs +25 -0
  40. package/dist/chunk-PSVXSTS4.mjs +51 -0
  41. package/dist/chunk-SNYWQI35.mjs +41 -0
  42. package/dist/chunk-TV4YHUBU.mjs +23 -0
  43. package/dist/chunk-UHUY6K7N.mjs +24 -0
  44. package/dist/chunk-UZ7BFUDR.mjs +258 -0
  45. package/dist/chunk-YLZC36RI.mjs +32 -0
  46. package/dist/chunk-ZNIXVHZT.mjs +24 -0
  47. package/dist/color.mjs +85 -0
  48. package/dist/console/enableConsole.mjs +9 -0
  49. package/dist/console/index.mjs +14 -0
  50. package/dist/console/log.mjs +19 -0
  51. package/dist/createDir-220e0081.d.ts +13 -0
  52. package/dist/device/browser.mjs +15 -0
  53. package/dist/device/camera.mjs +8 -0
  54. package/dist/device/index.mjs +15 -0
  55. package/dist/device/os.mjs +33 -0
  56. package/dist/enableConsole-ddc24282.d.ts +11 -0
  57. package/dist/file/createDir.mjs +7 -0
  58. package/dist/file/fileMove.mjs +7 -0
  59. package/dist/file/findFilesByExt.mjs +11 -0
  60. package/dist/file/index.mjs +17 -0
  61. package/dist/fileMove-3a09e429.d.ts +13 -0
  62. package/dist/findFilesByExt-753e91d7.d.ts +24 -0
  63. package/dist/gameboi/index.d.ts +2 -0
  64. package/dist/gameboi/index.js +5 -0
  65. package/dist/gameboi/index.js.map +1 -1
  66. package/dist/gameboi/index.mjs +65 -0
  67. package/dist/images/downloadByUrl.mjs +53 -0
  68. package/dist/images/index.mjs +14 -0
  69. package/dist/images/loadImage.js +1 -1
  70. package/dist/images/loadImage.js.map +1 -1
  71. package/dist/images/loadImage.mjs +21 -0
  72. package/dist/images/resize.mjs +9 -0
  73. package/dist/images/upload.mjs +13 -0
  74. package/dist/index-1e114d55.d.ts +26 -0
  75. package/dist/index-1f738e52.d.ts +22 -0
  76. package/dist/index-22309f0c.d.ts +23 -0
  77. package/dist/index-3eeb7834.d.ts +90 -0
  78. package/dist/index-6ae3c86b.d.ts +63 -0
  79. package/dist/index.mjs +87 -0
  80. package/dist/json.mjs +29 -0
  81. package/dist/math/diffDate.mjs +9 -0
  82. package/dist/math/index.mjs +34 -0
  83. package/dist/math/positiveNumber.mjs +10 -0
  84. package/dist/name/en.mjs +9 -0
  85. package/dist/name/index.mjs +20 -0
  86. package/dist/name/vi.mjs +14 -0
  87. package/dist/object-43aaaf92.d.ts +80 -0
  88. package/dist/object.mjs +21 -0
  89. package/dist/permission/index.mjs +15 -0
  90. package/dist/permission/requestCamera.mjs +9 -0
  91. package/dist/permission/requestDeviceOrientationControl.mjs +10 -0
  92. package/dist/requestCamera-32b7dfc7.d.ts +14 -0
  93. package/dist/requestDeviceOrientationControl-b6458660.d.ts +11 -0
  94. package/dist/response/index.mjs +16 -0
  95. package/dist/string/convertPathnameAndQuery.mjs +28 -0
  96. package/dist/string/formatNumber.mjs +10 -0
  97. package/dist/string/generatePassword.mjs +10 -0
  98. package/dist/string/generateUUID.mjs +9 -0
  99. package/dist/string/getTextBetweenCharByIndex.mjs +22 -0
  100. package/dist/string/index.mjs +31 -0
  101. package/dist/string/indexesOf.mjs +7 -0
  102. package/dist/string/makeDaySlug.mjs +9 -0
  103. package/dist/string/random.mjs +23 -0
  104. package/dist/string/trimNull.mjs +9 -0
  105. package/dist/string/url.mjs +21 -0
  106. package/dist/url-0da0be84.d.ts +43 -0
  107. package/esm/gameboi/index.d.ts +2 -0
  108. package/esm/gameboi/index.js +5 -0
  109. package/esm/gameboi/index.js.map +1 -1
  110. package/esm/images/loadImage.js +1 -1
  111. package/esm/images/loadImage.js.map +1 -1
  112. package/package.json +6 -2
@@ -0,0 +1,65 @@
1
+ import {
2
+ __privateAdd,
3
+ __privateGet,
4
+ __privateMethod,
5
+ __privateSet
6
+ } from "../chunk-4VQ25N7H.mjs";
7
+
8
+ // src/gameboi/index.ts
9
+ import EventEmitter from "events";
10
+ var ___onConnect, ___onDisconnect, ___start, _time, _awake, awake_fn;
11
+ var GameBoi = class extends EventEmitter {
12
+ constructor() {
13
+ super();
14
+ __privateAdd(this, _awake);
15
+ __privateAdd(this, ___onConnect, void 0);
16
+ __privateAdd(this, ___onDisconnect, void 0);
17
+ __privateAdd(this, ___start, void 0);
18
+ __privateAdd(this, _time, +/* @__PURE__ */ new Date());
19
+ __privateMethod(this, _awake, awake_fn).call(this);
20
+ }
21
+ onConnect(e) {
22
+ const gp = navigator.getGamepads()[e.gamepad.index];
23
+ console.log(`Gamepad connected at index ${gp.index}: ${gp.id}. It has ${gp.buttons.length} buttons and ${gp.axes.length} axes.`);
24
+ __privateSet(this, _time, +/* @__PURE__ */ new Date());
25
+ this.gameLoop();
26
+ }
27
+ onDisconnect() {
28
+ console.log("onDisconnect");
29
+ window.cancelAnimationFrame(__privateGet(this, ___start));
30
+ }
31
+ gameLoop() {
32
+ const gamepads = navigator.getGamepads();
33
+ if (!gamepads) {
34
+ return;
35
+ }
36
+ const deltaTime = (+/* @__PURE__ */ new Date() - __privateGet(this, _time)) / 1e3;
37
+ const item = gamepads[0];
38
+ item.deltaTime = deltaTime;
39
+ this.emit("update", item);
40
+ __privateSet(this, _time, +/* @__PURE__ */ new Date());
41
+ __privateSet(this, ___start, requestAnimationFrame(this.gameLoop.bind(this)));
42
+ }
43
+ dispose() {
44
+ this.onDisconnect();
45
+ window.removeEventListener("gamepadconnected", __privateGet(this, ___onConnect));
46
+ window.removeEventListener("gamepaddisconnected", __privateGet(this, ___onDisconnect));
47
+ }
48
+ };
49
+ ___onConnect = new WeakMap();
50
+ ___onDisconnect = new WeakMap();
51
+ ___start = new WeakMap();
52
+ _time = new WeakMap();
53
+ _awake = new WeakSet();
54
+ awake_fn = function() {
55
+ if (typeof window == "undefined")
56
+ return;
57
+ const scope = this;
58
+ __privateSet(this, ___onConnect, this.onConnect.bind(this));
59
+ window.addEventListener("gamepadconnected", __privateGet(this, ___onConnect));
60
+ __privateSet(this, ___onDisconnect, this.onDisconnect.bind(this));
61
+ window.addEventListener("gamepaddisconnected", __privateGet(this, ___onDisconnect));
62
+ };
63
+ export {
64
+ GameBoi as default
65
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ makeSlug
3
+ } from "../chunk-3OYOTSDB.mjs";
4
+ import {
5
+ isIos
6
+ } from "../chunk-32BJ2V3H.mjs";
7
+ import "../chunk-4VQ25N7H.mjs";
8
+
9
+ // src/images/downloadByUrl.ts
10
+ import { saveAs } from "file-saver";
11
+ async function downloadByUrl(url, name, title) {
12
+ return new Promise(async (resolve, reject) => {
13
+ var _a, _b, _c, _d, _e;
14
+ const blob = await fetch(url).then((r) => r.blob());
15
+ if (!blob)
16
+ reject(false);
17
+ const fileExt = (_c = blob.type) == null ? void 0 : _c.substring(((_a = blob.type) == null ? void 0 : _a.indexOf("/")) + 1, (_b = blob.type) == null ? void 0 : _b.length);
18
+ const fileName = `${name != null ? name : `image-${+/* @__PURE__ */ new Date()}`}.${fileExt}`;
19
+ if (isIos()) {
20
+ try {
21
+ const file = new File([blob], fileName, { type: blob.type });
22
+ const files = [file];
23
+ if ((navigator == null ? void 0 : navigator.canShare) && (navigator == null ? void 0 : navigator.canShare({ files }))) {
24
+ (_e = navigator == null ? void 0 : navigator.share) == null ? void 0 : _e.call(navigator, {
25
+ files,
26
+ title: (_d = title != null ? title : name) != null ? _d : fileName,
27
+ text: title ? makeSlug(title) : name != null ? name : fileName
28
+ }).then((e) => {
29
+ resolve(true);
30
+ }).catch((err) => {
31
+ var _a2;
32
+ if (((_a2 = err.message) == null ? void 0 : _a2.indexOf("cancellation")) >= 0) {
33
+ return;
34
+ }
35
+ saveAs(url, fileName);
36
+ resolve(true);
37
+ });
38
+ } else {
39
+ saveAs(url, fileName);
40
+ }
41
+ } catch (error) {
42
+ console.error(`downloadByUrl error`, error);
43
+ reject(error);
44
+ }
45
+ } else {
46
+ saveAs(url, fileName);
47
+ resolve(true);
48
+ }
49
+ });
50
+ }
51
+ export {
52
+ downloadByUrl as default
53
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ upload
3
+ } from "../chunk-YLZC36RI.mjs";
4
+ import "../chunk-32PJ3FML.mjs";
5
+ import {
6
+ resize
7
+ } from "../chunk-GJMNV2OC.mjs";
8
+ import "../chunk-GNJDIUYM.mjs";
9
+ import "../chunk-JAP2EUEW.mjs";
10
+ import "../chunk-4VQ25N7H.mjs";
11
+ export {
12
+ resize,
13
+ upload
14
+ };
@@ -8,7 +8,7 @@ async function loadImage(list) {
8
8
  return new Promise((resolve, reject) => {
9
9
  const img = new Image();
10
10
  img.onload = resolve;
11
- img.onerror = resolve;
11
+ img.onerror = reject;
12
12
  img.src = url;
13
13
  return;
14
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"loadImage.js","sourceRoot":"","sources":["../../src/images/loadImage.ts"],"names":[],"mappings":";;AAAe,KAAK,UAAU,SAAS,CAAC,IAAmB;IAC1D,EAAE;IACF,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA;QAAE,OAAO;IAE1B,OAAO,MAAM,OAAO,CAAC,GAAG,CACvB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;YACrB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;YACtB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;YACd,OAAO;QACR,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAfD,4BAeC"}
1
+ {"version":3,"file":"loadImage.js","sourceRoot":"","sources":["../../src/images/loadImage.ts"],"names":[],"mappings":";;AAAe,KAAK,UAAU,SAAS,CAAC,IAAmB;IAC1D,EAAE;IACF,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA;QAAE,OAAO;IAE1B,OAAO,MAAM,OAAO,CAAC,GAAG,CACvB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;YACrB,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;YACrB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;YACd,OAAO;QACR,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAfD,4BAeC"}
@@ -0,0 +1,21 @@
1
+ import "../chunk-4VQ25N7H.mjs";
2
+
3
+ // src/images/loadImage.ts
4
+ async function loadImage(list) {
5
+ if (!(list == null ? void 0 : list.length))
6
+ return;
7
+ return await Promise.all(
8
+ list.map((url) => {
9
+ return new Promise((resolve, reject) => {
10
+ const img = new Image();
11
+ img.onload = resolve;
12
+ img.onerror = resolve;
13
+ img.src = url;
14
+ return;
15
+ });
16
+ })
17
+ );
18
+ }
19
+ export {
20
+ loadImage as default
21
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ resize,
3
+ resize_default
4
+ } from "../chunk-GJMNV2OC.mjs";
5
+ import "../chunk-4VQ25N7H.mjs";
6
+ export {
7
+ resize_default as default,
8
+ resize
9
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ upload,
3
+ upload_default
4
+ } from "../chunk-YLZC36RI.mjs";
5
+ import "../chunk-32PJ3FML.mjs";
6
+ import "../chunk-GJMNV2OC.mjs";
7
+ import "../chunk-GNJDIUYM.mjs";
8
+ import "../chunk-JAP2EUEW.mjs";
9
+ import "../chunk-4VQ25N7H.mjs";
10
+ export {
11
+ upload_default as default,
12
+ upload
13
+ };
@@ -0,0 +1,26 @@
1
+ import { a as enableConsole } from './enableConsole-ddc24282.js';
2
+
3
+ declare const disableConsole: () => void;
4
+ declare const removeConsole: () => void;
5
+ declare const showCredit: () => void;
6
+
7
+ declare const xconsole: {
8
+ enableConsole: typeof enableConsole;
9
+ disableConsole: () => void;
10
+ removeConsole: () => void;
11
+ showCredit: () => void;
12
+ };
13
+
14
+ declare const console_disableConsole: typeof disableConsole;
15
+ declare const console_removeConsole: typeof removeConsole;
16
+ declare const console_showCredit: typeof showCredit;
17
+ declare namespace console {
18
+ export {
19
+ xconsole as default,
20
+ console_disableConsole as disableConsole,
21
+ console_removeConsole as removeConsole,
22
+ console_showCredit as showCredit,
23
+ };
24
+ }
25
+
26
+ export { console as c, disableConsole as d, removeConsole as r, showCredit as s, xconsole as x };
@@ -0,0 +1,22 @@
1
+ declare const isIos: () => boolean | null;
2
+ declare const isAndroid: () => boolean | null;
3
+ declare const isTablet: () => boolean | null;
4
+ declare const isMobile: () => boolean | null;
5
+ declare const checkOS: () => any;
6
+
7
+ declare const device_checkOS: typeof checkOS;
8
+ declare const device_isAndroid: typeof isAndroid;
9
+ declare const device_isIos: typeof isIos;
10
+ declare const device_isMobile: typeof isMobile;
11
+ declare const device_isTablet: typeof isTablet;
12
+ declare namespace device {
13
+ export {
14
+ device_checkOS as checkOS,
15
+ device_isAndroid as isAndroid,
16
+ device_isIos as isIos,
17
+ device_isMobile as isMobile,
18
+ device_isTablet as isTablet,
19
+ };
20
+ }
21
+
22
+ export { isAndroid as a, isTablet as b, isMobile as c, device as d, checkOS as e, isIos as i };
@@ -0,0 +1,23 @@
1
+ import NameEN, { generateName } from './name/en.js';
2
+ import NameVI from './name/vi.js';
3
+
4
+ declare const xname: {
5
+ NameEN: {
6
+ generateName: typeof generateName;
7
+ };
8
+ NameVI: {
9
+ generateName: (useGender?: boolean, male?: boolean) => any;
10
+ };
11
+ };
12
+
13
+ declare const xname$1_NameEN: typeof NameEN;
14
+ declare const xname$1_NameVI: typeof NameVI;
15
+ declare namespace xname$1 {
16
+ export {
17
+ xname$1_NameEN as NameEN,
18
+ xname$1_NameVI as NameVI,
19
+ xname as default,
20
+ };
21
+ }
22
+
23
+ export { xname as a, xname$1 as x };
@@ -0,0 +1,90 @@
1
+ import { makeDaySlug } from './string/makeDaySlug.js';
2
+ import generateUUID from './string/generateUUID.js';
3
+ import formatNumber from './string/formatNumber.js';
4
+ import generatePassword from './string/generatePassword.js';
5
+ import trimNull from './string/trimNull.js';
6
+
7
+ /**
8
+ * Get string between str1 and str2 from text
9
+ */
10
+ declare const getBetween: (text: string, str1: string, str2?: string) => string;
11
+ /**
12
+ * Convert object to string
13
+ */
14
+ declare const makeString: (object?: any) => string;
15
+ /**
16
+ * toUpperCase
17
+ */
18
+ declare const toUpperCase: (str?: string) => string;
19
+ /**
20
+ * toLowerCase
21
+ */
22
+ declare const toLowerCase: (str?: string) => string;
23
+ /**
24
+ * toLowerCase
25
+ * @param {*} str
26
+ * @return {string}
27
+ */
28
+ declare const titleize: (str?: string) => string;
29
+ /**
30
+ * Convert only first charater to UpperCase
31
+ */
32
+ declare const capitalize: (str: string | any, lowercaseRest?: number) => any;
33
+ /**
34
+ * Convert first character from every single words to UpperCase
35
+ */
36
+ declare const capitalizeName: (str: string) => string;
37
+ declare const clearUnicodeCharacters: (s: string, opt?: {
38
+ [key: string]: any;
39
+ }) => string;
40
+
41
+ declare const xstring: {
42
+ getBetween: (text: string, str1: string, str2?: string) => string;
43
+ makeString: (object?: any) => string;
44
+ makeDaySlug: typeof makeDaySlug;
45
+ toUpperCase: (str?: string) => string;
46
+ toLowerCase: (str?: string) => string;
47
+ titleize: (str?: string) => string;
48
+ capitalize: (str: string | any, lowercaseRest?: number) => any;
49
+ capitalizeName: (str: string) => string;
50
+ clearUnicodeCharacters: (s: string, opt?: {
51
+ [key: string]: any;
52
+ }) => string;
53
+ generateUUID: typeof generateUUID;
54
+ randAllCharacterByLength: (length?: number) => string;
55
+ randomStringByLength: (length: number, str?: string) => string;
56
+ formatNumber: typeof formatNumber;
57
+ generatePassword: typeof generatePassword;
58
+ trimNull: typeof trimNull;
59
+ addQueryParam: (_url: string, key: string, value: any) => string;
60
+ getUrlParams: (parameter: string, staticURL?: string | undefined, decode?: boolean) => string | false | undefined;
61
+ isLink: (str: string) => boolean;
62
+ getFileNameWithoutExtension: (url: string) => string;
63
+ getFileNameWithExtension: (url: string) => string;
64
+ getFileExtension: (url: string) => string | null | undefined;
65
+ isImage: (url: string) => boolean;
66
+ };
67
+
68
+ declare const string_capitalize: typeof capitalize;
69
+ declare const string_capitalizeName: typeof capitalizeName;
70
+ declare const string_clearUnicodeCharacters: typeof clearUnicodeCharacters;
71
+ declare const string_getBetween: typeof getBetween;
72
+ declare const string_makeString: typeof makeString;
73
+ declare const string_titleize: typeof titleize;
74
+ declare const string_toLowerCase: typeof toLowerCase;
75
+ declare const string_toUpperCase: typeof toUpperCase;
76
+ declare namespace string {
77
+ export {
78
+ string_capitalize as capitalize,
79
+ string_capitalizeName as capitalizeName,
80
+ string_clearUnicodeCharacters as clearUnicodeCharacters,
81
+ xstring as default,
82
+ string_getBetween as getBetween,
83
+ string_makeString as makeString,
84
+ string_titleize as titleize,
85
+ string_toLowerCase as toLowerCase,
86
+ string_toUpperCase as toUpperCase,
87
+ };
88
+ }
89
+
90
+ export { toLowerCase as a, titleize as b, capitalize as c, capitalizeName as d, clearUnicodeCharacters as e, getBetween as g, makeString as m, string as s, toUpperCase as t, xstring as x };
@@ -0,0 +1,63 @@
1
+ import diffDate from './math/diffDate.js';
2
+ import positiveNumber from './math/positiveNumber.js';
3
+
4
+ declare const randRound: (number: number) => number;
5
+ declare const rand: (number: number) => number;
6
+ declare const randHalt: (number: number) => number;
7
+ declare const randInt: (low: number, high: number) => number;
8
+ declare const randFloat: (low: number, high: number) => number;
9
+ declare const degToRad: (degrees: number) => number;
10
+ declare const radToDeg: (radians: number) => number;
11
+ declare const clamp: (value: number, min: number, max: number) => number;
12
+ declare const degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
13
+ declare const degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
14
+ declare const angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
15
+ declare const distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
16
+
17
+ declare const xmath: {
18
+ rand: (number: number) => number;
19
+ randRound: (number: number) => number;
20
+ randHalt: (number: number) => number;
21
+ randInt: (low: number, high: number) => number;
22
+ randFloat: (low: number, high: number) => number;
23
+ degToRad: (degrees: number) => number;
24
+ radToDeg: (radians: number) => number;
25
+ degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
26
+ degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
27
+ angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
28
+ distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
29
+ diffDate: typeof diffDate;
30
+ positiveNumber: typeof positiveNumber;
31
+ };
32
+
33
+ declare const math_angleBetweenPoints: typeof angleBetweenPoints;
34
+ declare const math_clamp: typeof clamp;
35
+ declare const math_degBetweenPoints: typeof degBetweenPoints;
36
+ declare const math_degBetweenPoints360: typeof degBetweenPoints360;
37
+ declare const math_degToRad: typeof degToRad;
38
+ declare const math_distance2Point: typeof distance2Point;
39
+ declare const math_radToDeg: typeof radToDeg;
40
+ declare const math_rand: typeof rand;
41
+ declare const math_randFloat: typeof randFloat;
42
+ declare const math_randHalt: typeof randHalt;
43
+ declare const math_randInt: typeof randInt;
44
+ declare const math_randRound: typeof randRound;
45
+ declare namespace math {
46
+ export {
47
+ math_angleBetweenPoints as angleBetweenPoints,
48
+ math_clamp as clamp,
49
+ xmath as default,
50
+ math_degBetweenPoints as degBetweenPoints,
51
+ math_degBetweenPoints360 as degBetweenPoints360,
52
+ math_degToRad as degToRad,
53
+ math_distance2Point as distance2Point,
54
+ math_radToDeg as radToDeg,
55
+ math_rand as rand,
56
+ math_randFloat as randFloat,
57
+ math_randHalt as randHalt,
58
+ math_randInt as randInt,
59
+ math_randRound as randRound,
60
+ };
61
+ }
62
+
63
+ export { rand as a, randHalt as b, randInt as c, randFloat as d, degToRad as e, radToDeg as f, clamp as g, degBetweenPoints360 as h, degBetweenPoints as i, angleBetweenPoints as j, distance2Point as k, math as m, randRound as r, xmath as x };
package/dist/index.mjs ADDED
@@ -0,0 +1,87 @@
1
+ import {
2
+ string_exports
3
+ } from "./chunk-4CWVMQ53.mjs";
4
+ import "./chunk-ZNIXVHZT.mjs";
5
+ import "./chunk-CKILLYAP.mjs";
6
+ import "./chunk-7XKT3AQX.mjs";
7
+ import "./chunk-HTAKHCLC.mjs";
8
+ import "./chunk-7MK72U4O.mjs";
9
+ import {
10
+ name_exports
11
+ } from "./chunk-UHUY6K7N.mjs";
12
+ import "./chunk-PMJLVOEM.mjs";
13
+ import {
14
+ requestDeviceOrientationControl_exports
15
+ } from "./chunk-SNYWQI35.mjs";
16
+ import "./chunk-DEOVENCJ.mjs";
17
+ import {
18
+ url_exports
19
+ } from "./chunk-JAP2EUEW.mjs";
20
+ import "./chunk-K4KENOE6.mjs";
21
+ import {
22
+ createDir_exports
23
+ } from "./chunk-TV4YHUBU.mjs";
24
+ import {
25
+ fileMove_exports
26
+ } from "./chunk-HN4EHJ2H.mjs";
27
+ import {
28
+ findFilesByExt_exports
29
+ } from "./chunk-D5JDP7JB.mjs";
30
+ import {
31
+ device_exports
32
+ } from "./chunk-32BJ2V3H.mjs";
33
+ import {
34
+ Timer_exports
35
+ } from "./chunk-FTXB3IBS.mjs";
36
+ import {
37
+ console_exports
38
+ } from "./chunk-24DHBJAC.mjs";
39
+ import {
40
+ enableConsole_exports
41
+ } from "./chunk-76AY2CWV.mjs";
42
+ import {
43
+ browser_exports
44
+ } from "./chunk-PSVXSTS4.mjs";
45
+ import {
46
+ camera_exports
47
+ } from "./chunk-AT5ZUBQL.mjs";
48
+ import {
49
+ requestCamera_exports
50
+ } from "./chunk-LGBBKRBU.mjs";
51
+ import {
52
+ array_exports
53
+ } from "./chunk-UZ7BFUDR.mjs";
54
+ import {
55
+ math_exports
56
+ } from "./chunk-JIMOWRMS.mjs";
57
+ import "./chunk-7SOQVGCL.mjs";
58
+ import "./chunk-FILFH56Y.mjs";
59
+ import {
60
+ object_exports
61
+ } from "./chunk-6OZHYD5H.mjs";
62
+ import "./chunk-4VQ25N7H.mjs";
63
+
64
+ // src/index.ts
65
+ var utils = {
66
+ xname: name_exports,
67
+ array: array_exports,
68
+ device: device_exports,
69
+ console: console_exports,
70
+ browser: browser_exports,
71
+ camera: camera_exports,
72
+ math: math_exports,
73
+ object: object_exports,
74
+ string: string_exports,
75
+ url: url_exports,
76
+ createDir: createDir_exports,
77
+ fileMove: fileMove_exports,
78
+ findFilesByExt: findFilesByExt_exports,
79
+ Timer: Timer_exports,
80
+ requestCamera: requestCamera_exports,
81
+ requestDeviceOrientationControl: requestDeviceOrientationControl_exports,
82
+ enableConsole: enableConsole_exports
83
+ };
84
+ var src_default = utils;
85
+ export {
86
+ src_default as default
87
+ };
package/dist/json.mjs ADDED
@@ -0,0 +1,29 @@
1
+ import "./chunk-4VQ25N7H.mjs";
2
+
3
+ // src/json.ts
4
+ var isValid = (content) => {
5
+ if (typeof content == "object") {
6
+ try {
7
+ content = JSON.stringify(content);
8
+ } catch (err) {
9
+ return false;
10
+ }
11
+ }
12
+ if (typeof content == "string") {
13
+ try {
14
+ content = JSON.parse(content);
15
+ } catch (err) {
16
+ return false;
17
+ }
18
+ }
19
+ if (typeof content != "object") {
20
+ return false;
21
+ }
22
+ return true;
23
+ };
24
+ var xjson = { isValid };
25
+ var json_default = xjson;
26
+ export {
27
+ json_default as default,
28
+ isValid
29
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ diffDate,
3
+ diffDate_default
4
+ } from "../chunk-7SOQVGCL.mjs";
5
+ import "../chunk-4VQ25N7H.mjs";
6
+ export {
7
+ diffDate_default as default,
8
+ diffDate
9
+ };
@@ -0,0 +1,34 @@
1
+ import {
2
+ angleBetweenPoints,
3
+ clamp,
4
+ degBetweenPoints,
5
+ degBetweenPoints360,
6
+ degToRad,
7
+ distance2Point,
8
+ math_default,
9
+ radToDeg,
10
+ rand,
11
+ randFloat,
12
+ randHalt,
13
+ randInt,
14
+ randRound
15
+ } from "../chunk-JIMOWRMS.mjs";
16
+ import "../chunk-7SOQVGCL.mjs";
17
+ import "../chunk-FILFH56Y.mjs";
18
+ import "../chunk-6OZHYD5H.mjs";
19
+ import "../chunk-4VQ25N7H.mjs";
20
+ export {
21
+ angleBetweenPoints,
22
+ clamp,
23
+ math_default as default,
24
+ degBetweenPoints,
25
+ degBetweenPoints360,
26
+ degToRad,
27
+ distance2Point,
28
+ radToDeg,
29
+ rand,
30
+ randFloat,
31
+ randHalt,
32
+ randInt,
33
+ randRound
34
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ positiveNumber,
3
+ positiveNumber_default
4
+ } from "../chunk-FILFH56Y.mjs";
5
+ import "../chunk-6OZHYD5H.mjs";
6
+ import "../chunk-4VQ25N7H.mjs";
7
+ export {
8
+ positiveNumber_default as default,
9
+ positiveNumber
10
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ en_default,
3
+ generateName
4
+ } from "../chunk-K4KENOE6.mjs";
5
+ import "../chunk-4VQ25N7H.mjs";
6
+ export {
7
+ en_default as default,
8
+ generateName
9
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ name_default
3
+ } from "../chunk-UHUY6K7N.mjs";
4
+ import {
5
+ vi_default
6
+ } from "../chunk-PMJLVOEM.mjs";
7
+ import {
8
+ en_default
9
+ } from "../chunk-K4KENOE6.mjs";
10
+ import "../chunk-UZ7BFUDR.mjs";
11
+ import "../chunk-JIMOWRMS.mjs";
12
+ import "../chunk-7SOQVGCL.mjs";
13
+ import "../chunk-FILFH56Y.mjs";
14
+ import "../chunk-6OZHYD5H.mjs";
15
+ import "../chunk-4VQ25N7H.mjs";
16
+ export {
17
+ en_default as NameEN,
18
+ vi_default as NameVI,
19
+ name_default as default
20
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ generateName,
3
+ vi_default
4
+ } from "../chunk-PMJLVOEM.mjs";
5
+ import "../chunk-UZ7BFUDR.mjs";
6
+ import "../chunk-JIMOWRMS.mjs";
7
+ import "../chunk-7SOQVGCL.mjs";
8
+ import "../chunk-FILFH56Y.mjs";
9
+ import "../chunk-6OZHYD5H.mjs";
10
+ import "../chunk-4VQ25N7H.mjs";
11
+ export {
12
+ vi_default as default,
13
+ generateName
14
+ };