diginext-utils 2.0.1 → 2.0.3

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 (50) hide show
  1. package/dist/Checker.d.ts +6 -0
  2. package/dist/EventDispatcher.d.ts +13 -0
  3. package/dist/FileUpload.d.ts +12 -0
  4. package/dist/Slug.d.ts +5 -0
  5. package/dist/Timer.d.ts +5 -0
  6. package/dist/Validation.d.ts +6 -0
  7. package/dist/array.d.ts +93 -0
  8. package/dist/{chunk-ACLBWYEO.mjs → chunk-7UXN7I4K.mjs} +1 -1
  9. package/dist/color.d.ts +12 -0
  10. package/dist/console/enableConsole.d.ts +3 -0
  11. package/dist/console/index.d.ts +5 -0
  12. package/dist/device/browser.d.ts +7 -0
  13. package/dist/device/camera.d.ts +16 -0
  14. package/dist/device.d.ts +6 -0
  15. package/dist/file/createDir.d.ts +6 -0
  16. package/dist/{backend/file → file}/createDir.js +1 -1
  17. package/dist/{backend/file → file}/createDir.mjs +2 -2
  18. package/dist/file/fileMove.d.ts +6 -0
  19. package/dist/{backend/file → file}/fileMove.js +1 -1
  20. package/dist/{backend/file → file}/fileMove.mjs +2 -2
  21. package/dist/file/findFilesByExt.d.ts +6 -0
  22. package/dist/{backend/file → file}/findFilesByExt.js +1 -1
  23. package/dist/{backend/file → file}/findFilesByExt.mjs +2 -2
  24. package/dist/index.d.ts +12 -0
  25. package/dist/index.js +1 -73
  26. package/dist/index.mjs +1 -2
  27. package/dist/math/diffDate.d.ts +6 -0
  28. package/dist/math/positiveNumber.d.ts +3 -0
  29. package/dist/math.d.ts +55 -0
  30. package/dist/name/en.d.ts +3 -0
  31. package/dist/{string/name → name}/en.js +1 -1
  32. package/dist/{string/name → name}/en.mjs +2 -2
  33. package/dist/name/vi.d.ts +3 -0
  34. package/dist/{string/name → name}/vi.js +1 -1
  35. package/dist/{string/name → name}/vi.mjs +4 -4
  36. package/dist/object.d.ts +25 -0
  37. package/dist/permission/requestCamera.d.ts +6 -0
  38. package/dist/permission/requestDeviceOrientationControl.d.ts +3 -0
  39. package/dist/string/formatNumber.d.ts +7 -0
  40. package/dist/string/generatePassword.d.ts +10 -0
  41. package/dist/string/generateUUID.d.ts +3 -0
  42. package/dist/string/index.d.ts +35 -0
  43. package/dist/{string.js → string/index.js} +1 -1
  44. package/dist/{string.mjs → string/index.mjs} +3 -3
  45. package/dist/string/random.d.ts +11 -0
  46. package/dist/string/trimNull.d.ts +3 -0
  47. package/dist/string/url.d.ts +33 -0
  48. package/dist/string/url.mjs +68 -2
  49. package/package.json +8 -4
  50. package/dist/chunk-Y4ZTQWPA.mjs +0 -68
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Check if the object or string is in JSON format
3
+ */
4
+ declare const isJSON: (content: object | string) => boolean;
5
+
6
+ export { isJSON };
@@ -0,0 +1,13 @@
1
+ declare class EventDispatcher {
2
+ constructor();
3
+ _listeners: any;
4
+ addEventListener(type: string, listener: any): void;
5
+ hasEventListener(type: string, listener: any): boolean;
6
+ removeEventListener(type: string, listener: any): void;
7
+ dispatchEvent(event: {
8
+ type: string;
9
+ target: any;
10
+ }): void;
11
+ }
12
+
13
+ export { EventDispatcher as default };
@@ -0,0 +1,12 @@
1
+ declare type UploadParams = {
2
+ blob: Blob;
3
+ url: string;
4
+ params: any;
5
+ onComplete: any;
6
+ onError: any;
7
+ };
8
+ declare const FileUpload: {
9
+ uploadBlob(props: UploadParams): void;
10
+ };
11
+
12
+ export { FileUpload as default };
package/dist/Slug.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare const makeSlug: (s: string, opt?: {
2
+ [key: string]: any;
3
+ }) => string;
4
+
5
+ export { makeSlug };
@@ -0,0 +1,5 @@
1
+ declare const Timer: {
2
+ wait: (ms: number) => Promise<unknown>;
3
+ };
4
+
5
+ export { Timer as default };
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ imageValidate(file: Blob): boolean;
3
+ videoValidate(file: Blob): boolean;
4
+ };
5
+
6
+ export { _default as default };
@@ -0,0 +1,93 @@
1
+ declare const sumArray: (array: [], key: string) => number;
2
+ /**
3
+ *
4
+ * @param {Array} array
5
+ * @param {string} key
6
+ * @returns {Number}
7
+ */
8
+ declare const averageArray: (array: [], key: string) => number;
9
+ /**
10
+ *
11
+ * @param {Array} array
12
+ * @param {string} key
13
+ * @returns {Number}
14
+ */
15
+ declare const minArray: (array: [], key: string) => number;
16
+ /**
17
+ *
18
+ * @param {Array} array
19
+ * @param {string} key
20
+ * @returns {Number}
21
+ */
22
+ declare const maxArray: (array: [], key: string) => number;
23
+ /**
24
+ *
25
+ * @param {Array} array
26
+ * @param {string} key
27
+ * @returns {Array}
28
+ */
29
+ declare const sortElementByString: (array: any, key: string) => any[];
30
+ /**
31
+ *
32
+ * @param {Array} array
33
+ * @param {string} key
34
+ * @returns {Array}
35
+ */
36
+ declare const sortElementByNumber: (array: any, key: string) => any[];
37
+ /**
38
+ *
39
+ * @param {Array} array
40
+ * @returns {any}
41
+ */
42
+ declare const firstElement: (array: any[]) => any;
43
+ /**
44
+ *
45
+ * @param {Array} array
46
+ * @returns {any}
47
+ */
48
+ declare const lastElement: (array: any[]) => any;
49
+ /**
50
+ *
51
+ * @param {Array} array
52
+ * @returns {any}
53
+ */
54
+ declare const randomIndex: (array: any[]) => number;
55
+ /**
56
+ *
57
+ * @param {Array} array
58
+ * @returns {any}
59
+ */
60
+ declare const randomElement: (array: any[]) => any;
61
+ /**
62
+ * Remove same elements from 2 arrays
63
+ */
64
+ declare const mergeAndMakeUniqueElement: (list1: any[], list2: any[], key: string) => any[];
65
+ /**
66
+ * check target == toMatch
67
+ * @param {Array} target
68
+ * @param {Array} toMatch
69
+ * @returns {Boolean}
70
+ */
71
+ declare const allMatchInArray: (target: any[], toMatch: any[]) => boolean;
72
+ declare const removeItem: (item: any, array: any[]) => any[];
73
+ declare const removeItemByKey: (key: string, value: any, array: any[]) => any[];
74
+ declare const getRandom: (array: any[], n: number) => any[];
75
+ /**
76
+ * Get an array with shuffle element
77
+ */
78
+ declare const getHalfRandom: (array: any[], n: number) => any[];
79
+ /**
80
+ * Make array shuffle itself
81
+ */
82
+ declare const shuffle: (array: any[]) => any[];
83
+ /**
84
+ *
85
+ * @param {Array} array
86
+ * @param {Number} oldIndex
87
+ * @param {Number} newIndex
88
+ * @returns {Array}
89
+ */
90
+ declare const moveIndex: (array: any[], oldIndex: number, newIndex: number) => any[];
91
+ declare const moveArray: (array: any[], oldIndex: number, newIndex: number) => any[];
92
+
93
+ export { allMatchInArray, averageArray, firstElement, getHalfRandom, getRandom, lastElement, maxArray, mergeAndMakeUniqueElement, minArray, moveArray, moveIndex, randomElement, randomIndex, removeItem, removeItemByKey, shuffle, sortElementByNumber, sortElementByString, sumArray };
@@ -1,6 +1,6 @@
1
1
  import { isNull } from './chunk-5AL36RZR.mjs';
2
2
 
3
- // src/string.ts
3
+ // src/string/index.ts
4
4
  var char_map = { \u00C0: "A", \u00C1: "A", \u00C2: "A", \u00C3: "A", \u00C4: "A", \u00C5: "A", \u00C6: "AE", \u00C7: "C", \u00C8: "E", \u00C9: "E", \u00CA: "E", \u00CB: "E", \u00CC: "I", \u00CD: "I", \u00CE: "I", \u00CF: "I", \u00D0: "D", \u00D1: "N", \u00D2: "O", \u00D3: "O", \u00D4: "O", \u00D5: "O", \u00D6: "O", \u0150: "O", \u00D8: "O", \u00D9: "U", \u00DA: "U", \u00DB: "U", \u0170: "U", \u00DD: "Y", \u00DE: "TH", \u00DF: "ss", \u00E0: "a", \u00E1: "a", \u00E2: "a", \u00E3: "a", \u00E4: "a", \u00E5: "a", \u00E6: "ae", \u00E8: "e", \u00E9: "e", \u00EA: "e", \u00EB: "e", \u00EC: "i", \u00ED: "i", \u00EE: "i", \u00EF: "i", \u00F0: "d", \u00F1: "n", \u00F2: "o", \u00F3: "o", \u00F4: "o", \u00F5: "o", \u00F6: "o", \u0151: "o", \u00F8: "o", \u00F9: "u", \u00FA: "u", \u00FB: "u", \u0171: "u", \u00FD: "y", \u00FE: "th", \u00FF: "y", "\xA9": "(c)", \u0393: "G", \u0394: "D", \u0398: "8", \u039B: "L", \u039E: "3", \u03A0: "P", \u03A3: "S", \u03A6: "F", \u03A8: "PS", \u03A9: "W", \u0386: "A", \u0388: "E", \u038A: "I", \u038C: "O", \u038E: "Y", \u0389: "H", \u038F: "W", \u03AA: "I", \u03AB: "Y", \u03B2: "b", "\u03B3": "y", \u03B4: "d", \u03B5: "e", \u03B6: "z", \u03B7: "h", \u03B8: "8", \u03B9: "i", \u03BA: "k", \u03BB: "l", \u03BC: "m", \u03BD: "n", \u03BE: "3", \u03BF: "o", \u03C0: "p", \u03C1: "r", \u03C3: "s", \u03C4: "t", \u03C5: "y", \u03C6: "f", \u03C7: "x", \u03C8: "ps", \u03C9: "w", \u03AC: "a", \u03AD: "e", \u03AF: "i", \u03CC: "o", \u03CD: "y", \u03AE: "h", \u03CE: "w", \u03C2: "s", \u03CA: "i", \u03B0: "y", \u03CB: "y", \u0390: "i", \u015E: "S", \u0130: "I", \u00DC: "U", \u011E: "G", \u015F: "s", \u0131: "i", \u00E7: "c", \u00FC: "u", \u011F: "g", \u0410: "A", \u0411: "B", \u0412: "V", \u0413: "G", \u0414: "D", \u0415: "E", \u0401: "Yo", \u0416: "Zh", \u0417: "Z", \u0418: "I", \u0419: "J", \u041A: "K", \u041B: "L", \u041C: "M", \u041D: "N", \u041E: "O", \u041F: "P", \u0420: "R", \u0421: "S", \u0422: "T", \u0423: "U", \u0424: "F", \u0425: "H", \u0426: "C", \u0427: "Ch", \u0428: "Sh", \u0429: "Sh", \u042A: "", \u042B: "Y", \u042C: "", \u042D: "E", \u042E: "Yu", \u042F: "Ya", \u0430: "a", \u0431: "b", \u0432: "v", \u0433: "g", \u0434: "d", \u0435: "e", \u0451: "yo", \u0436: "zh", \u0437: "z", \u0438: "i", \u0439: "j", \u043A: "k", \u043B: "l", \u043C: "m", \u043D: "n", \u043E: "o", \u043F: "p", \u0440: "r", \u0441: "s", \u0442: "t", \u0443: "u", \u0444: "f", \u0445: "h", \u0446: "c", \u0447: "ch", \u0448: "sh", \u0449: "sh", \u044A: "", \u044B: "y", \u044C: "", \u044D: "e", \u044E: "yu", \u044F: "ya", \u0404: "Ye", \u0406: "I", \u0407: "Yi", \u0490: "G", \u0454: "ye", \u0456: "i", \u0457: "yi", \u0491: "g", \u010C: "C", \u010E: "D", \u011A: "E", \u0147: "N", \u0158: "R", \u0160: "S", \u0164: "T", \u016E: "U", \u017D: "Z", \u010D: "c", \u010F: "d", \u011B: "e", \u0148: "n", \u0159: "r", \u0161: "s", \u0165: "t", \u016F: "u", \u017E: "z", \u0104: "A", \u0106: "C", \u0118: "e", \u0141: "L", \u0143: "N", \u015A: "S", \u0179: "Z", \u017B: "Z", \u0105: "a", \u0107: "c", \u0119: "e", \u0142: "l", \u0144: "n", \u015B: "s", \u017A: "z", \u017C: "z", \u0100: "A", \u0112: "E", \u0122: "G", \u012A: "i", \u0136: "k", \u013B: "L", \u0145: "N", \u016A: "u", \u0101: "a", \u0113: "e", \u0123: "g", \u012B: "i", \u0137: "k", \u013C: "l", \u0146: "n", \u016B: "u" };
5
5
  var getBetween = (text, str1, str2 = "") => {
6
6
  if (!text)
@@ -0,0 +1,12 @@
1
+ declare const random: (hex?: boolean) => string;
2
+ declare const pSBC: (p: any, c0: any, c1?: any, l?: any) => string;
3
+ declare const hexToRgb: (hex: string) => {
4
+ r: number;
5
+ g: number;
6
+ b: number;
7
+ };
8
+ declare const hexDarken: (hex: string, amount: number) => string;
9
+ declare const hexLighten: (hex: string, amount: number) => string;
10
+ declare const RGBToHex: (rgb: string | any) => string;
11
+
12
+ export { RGBToHex, hexDarken, hexLighten, hexToRgb, pSBC, random };
@@ -0,0 +1,3 @@
1
+ declare function enableConsole(): Console;
2
+
3
+ export { enableConsole as default };
@@ -0,0 +1,5 @@
1
+ declare const disableConsole: (params: any) => void;
2
+ declare const removeConsole: (params: any) => void;
3
+ declare const showCredit: (params: any) => void;
4
+
5
+ export { disableConsole, removeConsole, showCredit };
@@ -0,0 +1,7 @@
1
+ declare const isPotrait: () => boolean;
2
+ declare const isLandscape: () => boolean;
3
+ declare const ua: () => any;
4
+ declare const isFacebookWebview: () => boolean;
5
+ declare const isInAppWebview: () => boolean;
6
+
7
+ export { isFacebookWebview, isInAppWebview, isLandscape, isPotrait, ua };
@@ -0,0 +1,16 @@
1
+ /**
2
+ *
3
+ * @param {{
4
+ * container,
5
+ * facingMode : environment | user,
6
+ * audio : boolean,
7
+ * }} param0
8
+ * @returns
9
+ */
10
+ declare function getWebcam({ container, facingMode, audio, }: {
11
+ container: any;
12
+ facingMode?: string;
13
+ audio?: boolean;
14
+ }): Promise<unknown>;
15
+
16
+ export { getWebcam };
@@ -0,0 +1,6 @@
1
+ declare const isIos: () => boolean;
2
+ declare const isAndroid: () => boolean;
3
+ declare const isMobile: () => boolean;
4
+ declare const checkOS: () => any;
5
+
6
+ export { checkOS, isAndroid, isIos, isMobile };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Create new directory
3
+ */
4
+ declare function createDir(path: string): boolean;
5
+
6
+ export { createDir as default };
@@ -8,7 +8,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
8
8
  throw new Error('Dynamic require of "' + x + '" is not supported');
9
9
  });
10
10
 
11
- // src/backend/file/createDir.ts
11
+ // src/file/createDir.ts
12
12
  var fs = __require("fs");
13
13
  function createDir(path) {
14
14
  if (fs.existsSync(path)) {
@@ -1,6 +1,6 @@
1
- import { __require } from '../../chunk-AKU6F3WT.mjs';
1
+ import { __require } from '../chunk-AKU6F3WT.mjs';
2
2
 
3
- // src/backend/file/createDir.ts
3
+ // src/file/createDir.ts
4
4
  var fs = __require("fs");
5
5
  function createDir(path) {
6
6
  if (fs.existsSync(path)) {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Move file to another location.
3
+ */
4
+ declare function fileMove(oldPath: string, newPath: string, callback: any): void;
5
+
6
+ export { fileMove as default };
@@ -8,7 +8,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
8
8
  throw new Error('Dynamic require of "' + x + '" is not supported');
9
9
  });
10
10
 
11
- // src/backend/file/fileMove.ts
11
+ // src/file/fileMove.ts
12
12
  var fs = __require("fs");
13
13
  function fileMove(oldPath, newPath, callback) {
14
14
  fs.rename(oldPath, newPath, function(err) {
@@ -1,6 +1,6 @@
1
- import { __require } from '../../chunk-AKU6F3WT.mjs';
1
+ import { __require } from '../chunk-AKU6F3WT.mjs';
2
2
 
3
- // src/backend/file/fileMove.ts
3
+ // src/file/fileMove.ts
4
4
  var fs = __require("fs");
5
5
  function fileMove(oldPath, newPath, callback) {
6
6
  fs.rename(oldPath, newPath, function(err) {
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ */
4
+ declare const forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
5
+
6
+ export { forEachFileByExt as default };
@@ -8,7 +8,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
8
8
  throw new Error('Dynamic require of "' + x + '" is not supported');
9
9
  });
10
10
 
11
- // src/backend/file/findFilesByExt.ts
11
+ // src/file/findFilesByExt.ts
12
12
  var path = __require("path");
13
13
  var fs = __require("fs");
14
14
  var forEachFileByExt = (base, ext, cb) => {
@@ -1,6 +1,6 @@
1
- import { __require } from '../../chunk-AKU6F3WT.mjs';
1
+ import { __require } from '../chunk-AKU6F3WT.mjs';
2
2
 
3
- // src/backend/file/findFilesByExt.ts
3
+ // src/file/findFilesByExt.ts
4
4
  var path = __require("path");
5
5
  var fs = __require("fs");
6
6
  var forEachFileByExt = (base, ext, cb) => {
@@ -0,0 +1,12 @@
1
+ export { allMatchInArray, averageArray, firstElement, getHalfRandom, getRandom, lastElement, maxArray, mergeAndMakeUniqueElement, minArray, moveArray, moveIndex, randomElement, randomIndex, removeItem, removeItemByKey, shuffle, sortElementByNumber, sortElementByString, sumArray } from './array.js';
2
+ export { checkOS, isAndroid, isIos, isMobile } from './device.js';
3
+ export { disableConsole, removeConsole, showCredit } from './console/index.js';
4
+ export { isFacebookWebview, isInAppWebview, isLandscape, isPotrait, ua } from './device/browser.js';
5
+ export { getWebcam } from './device/camera.js';
6
+ export { angleBetweenPoints, degToRad, radToDeg, rand, randFloat, randHalt, randInt, randRound } from './math.js';
7
+ export { isNull, objectToArray, toArray, toBool, toFloat, toInt } from './object.js';
8
+ export { capitalize, capitalizeName, clearUnicodeCharacters, getBetween, makeString, titleize, toLowerCase, toUpperCase } from './string/index.js';
9
+ export { default as Timer } from './Timer.js';
10
+ export { default as requestCamera } from './permission/requestCamera.js';
11
+ export { default as requestDeviceOrientationControl } from './permission/requestDeviceOrientationControl.js';
12
+ export { default as enableConsole } from './console/enableConsole.js';
package/dist/index.js CHANGED
@@ -642,7 +642,7 @@ var objectToArray = (obj) => {
642
642
  return array;
643
643
  };
644
644
 
645
- // src/string.ts
645
+ // src/string/index.ts
646
646
  var char_map = { \u00C0: "A", \u00C1: "A", \u00C2: "A", \u00C3: "A", \u00C4: "A", \u00C5: "A", \u00C6: "AE", \u00C7: "C", \u00C8: "E", \u00C9: "E", \u00CA: "E", \u00CB: "E", \u00CC: "I", \u00CD: "I", \u00CE: "I", \u00CF: "I", \u00D0: "D", \u00D1: "N", \u00D2: "O", \u00D3: "O", \u00D4: "O", \u00D5: "O", \u00D6: "O", \u0150: "O", \u00D8: "O", \u00D9: "U", \u00DA: "U", \u00DB: "U", \u0170: "U", \u00DD: "Y", \u00DE: "TH", \u00DF: "ss", \u00E0: "a", \u00E1: "a", \u00E2: "a", \u00E3: "a", \u00E4: "a", \u00E5: "a", \u00E6: "ae", \u00E8: "e", \u00E9: "e", \u00EA: "e", \u00EB: "e", \u00EC: "i", \u00ED: "i", \u00EE: "i", \u00EF: "i", \u00F0: "d", \u00F1: "n", \u00F2: "o", \u00F3: "o", \u00F4: "o", \u00F5: "o", \u00F6: "o", \u0151: "o", \u00F8: "o", \u00F9: "u", \u00FA: "u", \u00FB: "u", \u0171: "u", \u00FD: "y", \u00FE: "th", \u00FF: "y", "\xA9": "(c)", \u0393: "G", \u0394: "D", \u0398: "8", \u039B: "L", \u039E: "3", \u03A0: "P", \u03A3: "S", \u03A6: "F", \u03A8: "PS", \u03A9: "W", \u0386: "A", \u0388: "E", \u038A: "I", \u038C: "O", \u038E: "Y", \u0389: "H", \u038F: "W", \u03AA: "I", \u03AB: "Y", \u03B2: "b", "\u03B3": "y", \u03B4: "d", \u03B5: "e", \u03B6: "z", \u03B7: "h", \u03B8: "8", \u03B9: "i", \u03BA: "k", \u03BB: "l", \u03BC: "m", \u03BD: "n", \u03BE: "3", \u03BF: "o", \u03C0: "p", \u03C1: "r", \u03C3: "s", \u03C4: "t", \u03C5: "y", \u03C6: "f", \u03C7: "x", \u03C8: "ps", \u03C9: "w", \u03AC: "a", \u03AD: "e", \u03AF: "i", \u03CC: "o", \u03CD: "y", \u03AE: "h", \u03CE: "w", \u03C2: "s", \u03CA: "i", \u03B0: "y", \u03CB: "y", \u0390: "i", \u015E: "S", \u0130: "I", \u00DC: "U", \u011E: "G", \u015F: "s", \u0131: "i", \u00E7: "c", \u00FC: "u", \u011F: "g", \u0410: "A", \u0411: "B", \u0412: "V", \u0413: "G", \u0414: "D", \u0415: "E", \u0401: "Yo", \u0416: "Zh", \u0417: "Z", \u0418: "I", \u0419: "J", \u041A: "K", \u041B: "L", \u041C: "M", \u041D: "N", \u041E: "O", \u041F: "P", \u0420: "R", \u0421: "S", \u0422: "T", \u0423: "U", \u0424: "F", \u0425: "H", \u0426: "C", \u0427: "Ch", \u0428: "Sh", \u0429: "Sh", \u042A: "", \u042B: "Y", \u042C: "", \u042D: "E", \u042E: "Yu", \u042F: "Ya", \u0430: "a", \u0431: "b", \u0432: "v", \u0433: "g", \u0434: "d", \u0435: "e", \u0451: "yo", \u0436: "zh", \u0437: "z", \u0438: "i", \u0439: "j", \u043A: "k", \u043B: "l", \u043C: "m", \u043D: "n", \u043E: "o", \u043F: "p", \u0440: "r", \u0441: "s", \u0442: "t", \u0443: "u", \u0444: "f", \u0445: "h", \u0446: "c", \u0447: "ch", \u0448: "sh", \u0449: "sh", \u044A: "", \u044B: "y", \u044C: "", \u044D: "e", \u044E: "yu", \u044F: "ya", \u0404: "Ye", \u0406: "I", \u0407: "Yi", \u0490: "G", \u0454: "ye", \u0456: "i", \u0457: "yi", \u0491: "g", \u010C: "C", \u010E: "D", \u011A: "E", \u0147: "N", \u0158: "R", \u0160: "S", \u0164: "T", \u016E: "U", \u017D: "Z", \u010D: "c", \u010F: "d", \u011B: "e", \u0148: "n", \u0159: "r", \u0161: "s", \u0165: "t", \u016F: "u", \u017E: "z", \u0104: "A", \u0106: "C", \u0118: "e", \u0141: "L", \u0143: "N", \u015A: "S", \u0179: "Z", \u017B: "Z", \u0105: "a", \u0107: "c", \u0119: "e", \u0142: "l", \u0144: "n", \u015B: "s", \u017A: "z", \u017C: "z", \u0100: "A", \u0112: "E", \u0122: "G", \u012A: "i", \u0136: "k", \u013B: "L", \u0145: "N", \u016A: "u", \u0101: "a", \u0113: "e", \u0123: "g", \u012B: "i", \u0137: "k", \u013C: "l", \u0146: "n", \u016B: "u" };
647
647
  var getBetween = (text, str1, str2 = "") => {
648
648
  if (!text)
@@ -724,71 +724,6 @@ var clearUnicodeCharacters = (s, opt = {}) => {
724
724
  return opt.lowercase ? s.toLowerCase() : s;
725
725
  };
726
726
 
727
- // src/string/url.ts
728
- var urlRegex = /(https?:\/\/[^\s]+)/g;
729
- var addQueryParam = (_url, key, value) => {
730
- _url += (_url.split("?")[1] ? "&" : "?") + `${key}=${value}`;
731
- return _url;
732
- };
733
- var getUrlParams = (parameter, staticURL, decode = true) => {
734
- if (typeof window == "undefined")
735
- return "";
736
- staticURL = staticURL == void 0 ? window.location.host : staticURL;
737
- var currLocation = staticURL.length > 0 ? staticURL : window.location.search;
738
- if (currLocation.split("?").length < 2)
739
- return "";
740
- var parArr = currLocation.split("?")[1].split("&"), returnBool = true;
741
- for (var i = 0; i < parArr.length; i++) {
742
- var parr = parArr[i].split("=");
743
- if (parr[0] == parameter) {
744
- return decode ? decodeURIComponent(parr[1]) : parr[1];
745
- } else {
746
- returnBool = false;
747
- }
748
- }
749
- if (!returnBool)
750
- return false;
751
- };
752
- var isLink = (str) => {
753
- return urlRegex.test(str);
754
- };
755
- var getFileNameWithoutExtension = (url) => {
756
- url = decodeURIComponent(url);
757
- if (url) {
758
- const m = url.toString().match(/.*\/(.+?)\./);
759
- if (m && m.length > 1) {
760
- return m[1];
761
- }
762
- if (!isNull(url)) {
763
- return url.split(".").shift();
764
- }
765
- }
766
- return "";
767
- };
768
- var getFileNameWithExtension = (url) => {
769
- url = decodeURIComponent(url);
770
- if (url) {
771
- const m = url.toString().match(/.*\/(.*)$/);
772
- if (m && m.length > 1) {
773
- return m[1].split("/").pop().split("?")[0];
774
- }
775
- if (!isNull(url)) {
776
- return url;
777
- }
778
- }
779
- return "";
780
- };
781
- var getFileExtension = (url) => {
782
- return getFileNameWithExtension(url).split(".").pop();
783
- };
784
- var isImage = (url) => {
785
- const arr = ["png", "jpg", "jpeg", "jpe", "jif", "jfif", "gif", "svg"];
786
- const index = arr.findIndex((item) => {
787
- return getFileExtension(url).toLowerCase() == item;
788
- });
789
- return index >= 0;
790
- };
791
-
792
727
  // src/Timer.ts
793
728
  var Timer = {
794
729
  wait: async (ms) => {
@@ -826,7 +761,6 @@ function enableConsole() {
826
761
  }
827
762
 
828
763
  exports.Timer = Timer_default;
829
- exports.addQueryParam = addQueryParam;
830
764
  exports.allMatchInArray = allMatchInArray;
831
765
  exports.angleBetweenPoints = angleBetweenPoints;
832
766
  exports.averageArray = averageArray;
@@ -839,20 +773,14 @@ exports.disableConsole = disableConsole;
839
773
  exports.enableConsole = enableConsole;
840
774
  exports.firstElement = firstElement;
841
775
  exports.getBetween = getBetween;
842
- exports.getFileExtension = getFileExtension;
843
- exports.getFileNameWithExtension = getFileNameWithExtension;
844
- exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
845
776
  exports.getHalfRandom = getHalfRandom;
846
777
  exports.getRandom = getRandom;
847
- exports.getUrlParams = getUrlParams;
848
778
  exports.getWebcam = getWebcam;
849
779
  exports.isAndroid = isAndroid;
850
780
  exports.isFacebookWebview = isFacebookWebview;
851
- exports.isImage = isImage;
852
781
  exports.isInAppWebview = isInAppWebview;
853
782
  exports.isIos = isIos;
854
783
  exports.isLandscape = isLandscape;
855
- exports.isLink = isLink;
856
784
  exports.isMobile = isMobile;
857
785
  exports.isNull = isNull;
858
786
  exports.isPotrait = isPotrait;
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
- export { addQueryParam, getFileExtension, getFileNameWithExtension, getFileNameWithoutExtension, getUrlParams, isImage, isLink } from './chunk-Y4ZTQWPA.mjs';
2
1
  export { requestDeviceOrientationControl_default as requestDeviceOrientationControl } from './chunk-VZGV2BTL.mjs';
3
- export { capitalize, capitalizeName, clearUnicodeCharacters, getBetween, makeString, titleize, toLowerCase, toUpperCase } from './chunk-ACLBWYEO.mjs';
2
+ export { capitalize, capitalizeName, clearUnicodeCharacters, getBetween, makeString, titleize, toLowerCase, toUpperCase } from './chunk-7UXN7I4K.mjs';
4
3
  export { isNull, objectToArray, toArray, toBool, toFloat, toInt } from './chunk-5AL36RZR.mjs';
5
4
  export { enableConsole } from './chunk-AHFJBIQJ.mjs';
6
5
  export { disableConsole, removeConsole, showCredit } from './chunk-LXQIKFED.mjs';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns amount of different days between 2 dates
3
+ */
4
+ declare function diffDate(date1: string, date2: string): number;
5
+
6
+ export { diffDate as default };
@@ -0,0 +1,3 @@
1
+ declare function positiveNumber(number: number): number;
2
+
3
+ export { positiveNumber as default };
package/dist/math.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ *
3
+ * @param {Number} number
4
+ * @return {Number}
5
+ */
6
+ declare const randRound: (number: number) => number;
7
+ /**
8
+ *
9
+ * @param {Number} number
10
+ * @return {Number}
11
+ */
12
+ declare const rand: (number: number) => number;
13
+ /**
14
+ *
15
+ * @param {Number} number
16
+ * @return {Number}
17
+ */
18
+ declare const randHalt: (number: number) => number;
19
+ /**
20
+ *
21
+ * @param {Number} low
22
+ * @param {Number} high
23
+ * @return {Number}
24
+ */
25
+ declare const randInt: (low: number, high: number) => number;
26
+ /**
27
+ *
28
+ * @param {Number} low
29
+ * @param {Number} high
30
+ * @return {Number}
31
+ */
32
+ declare const randFloat: (low: number, high: number) => number;
33
+ /**
34
+ *
35
+ * @param {Number} degrees
36
+ * @return {Number}
37
+ */
38
+ declare const degToRad: (degrees: number) => number;
39
+ /**
40
+ *
41
+ * @param {Number} degrees
42
+ * @return {Number}
43
+ */
44
+ declare const radToDeg: (radians: number) => number;
45
+ /**
46
+ *
47
+ * @param {Number} cx
48
+ * @param {Number} cy
49
+ * @param {Number} ex
50
+ * @param {Number} ey
51
+ * @returns {Number}
52
+ */
53
+ declare const angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
54
+
55
+ export { angleBetweenPoints, degToRad, radToDeg, rand, randFloat, randHalt, randInt, randRound };
@@ -0,0 +1,3 @@
1
+ declare function generateName(): string;
2
+
3
+ export { generateName };
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- // src/string/name/en.ts
5
+ // src/name/en.ts
6
6
  function capFirst(string) {
7
7
  return string.charAt(0).toUpperCase() + string.slice(1);
8
8
  }
@@ -1,6 +1,6 @@
1
- import '../../chunk-AKU6F3WT.mjs';
1
+ import '../chunk-AKU6F3WT.mjs';
2
2
 
3
- // src/string/name/en.ts
3
+ // src/name/en.ts
4
4
  function capFirst(string) {
5
5
  return string.charAt(0).toUpperCase() + string.slice(1);
6
6
  }
@@ -0,0 +1,3 @@
1
+ declare const generateName: (useGender?: boolean, male?: boolean) => Promise<any>;
2
+
3
+ export { generateName };