diginext-utils 2.1.2 → 2.1.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 (55) hide show
  1. package/dist/Checker.d.ts +3 -4
  2. package/dist/EventDispatcher.d.ts +3 -3
  3. package/dist/FileUpload.d.ts +3 -3
  4. package/dist/Slug.d.ts +3 -4
  5. package/dist/Timer.d.ts +4 -1
  6. package/dist/Validation.d.ts +2 -3
  7. package/dist/array.d.ts +113 -1
  8. package/dist/color.d.ts +8 -9
  9. package/dist/console/enableConsole.d.ts +2 -1
  10. package/dist/console/index.d.ts +11 -2
  11. package/dist/console/log.d.ts +8 -9
  12. package/dist/device/browser.d.ts +5 -1
  13. package/dist/device/camera.d.ts +7 -1
  14. package/dist/device/index.d.ts +5 -1
  15. package/dist/device/os.d.ts +6 -7
  16. package/dist/file/createDir.d.ts +5 -1
  17. package/dist/file/fileMove.d.ts +4 -1
  18. package/dist/file/findFilesByExt.d.ts +13 -1
  19. package/dist/file/index.d.ts +4 -6
  20. package/dist/gameboi/index.d.ts +4 -6
  21. package/dist/images/index.d.ts +2 -2
  22. package/dist/images/loadImage.d.ts +1 -3
  23. package/dist/images/resize.d.ts +2 -3
  24. package/dist/images/upload.d.ts +3 -4
  25. package/dist/index.d.ts +19 -30
  26. package/dist/json.d.ts +3 -4
  27. package/dist/math/diffDate.d.ts +2 -3
  28. package/dist/math/index.d.ts +30 -3
  29. package/dist/math/positiveNumber.d.ts +2 -3
  30. package/dist/name/en.d.ts +3 -4
  31. package/dist/name/index.d.ts +12 -3
  32. package/dist/name/vi.d.ts +3 -4
  33. package/dist/object.d.ts +59 -1
  34. package/dist/permission/index.d.ts +2 -3
  35. package/dist/permission/requestCamera.d.ts +5 -1
  36. package/dist/permission/requestDeviceOrientationControl.d.ts +2 -1
  37. package/dist/response/index.d.ts +6 -7
  38. package/dist/string/convertPathnameAndQuery.d.ts +2 -4
  39. package/dist/string/convertPathnameAndQuery.js +4 -0
  40. package/dist/string/convertPathnameAndQuery.js.map +1 -1
  41. package/dist/string/formatNumber.d.ts +2 -3
  42. package/dist/string/generatePassword.d.ts +2 -3
  43. package/dist/string/generateUUID.d.ts +2 -3
  44. package/dist/string/getTextBetweenCharByIndex.d.ts +1 -3
  45. package/dist/string/index.d.ts +65 -6
  46. package/dist/string/indexesOf.d.ts +1 -3
  47. package/dist/string/makeDaySlug.d.ts +3 -4
  48. package/dist/string/random.d.ts +9 -10
  49. package/dist/string/trimNull.d.ts +2 -3
  50. package/dist/string/url.d.ts +27 -1
  51. package/esm/string/convertPathnameAndQuery.d.ts +1 -1
  52. package/esm/string/convertPathnameAndQuery.js +4 -0
  53. package/esm/string/convertPathnameAndQuery.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/string/convertPathnameAndQuery.ts +3 -0
package/dist/Checker.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Check if the object or string is in JSON format
3
3
  */
4
- declare const isJSON: (content: object | string) => boolean;
4
+ export declare const isJSON: (content: object | string) => boolean;
5
5
  declare const Checker: {
6
6
  isJSON: (content: object | string) => boolean;
7
- };
8
-
9
- export { Checker as default, isJSON };
7
+ };
8
+ export default Checker;
@@ -8,6 +8,6 @@ declare class EventDispatcher {
8
8
  type: string;
9
9
  target: any;
10
10
  }): void;
11
- }
12
-
13
- export { EventDispatcher, EventDispatcher as default };
11
+ }
12
+ export { EventDispatcher };
13
+ export default EventDispatcher;
@@ -7,6 +7,6 @@ type UploadParams = {
7
7
  };
8
8
  declare const FileUpload: {
9
9
  uploadBlob(props: UploadParams): void;
10
- };
11
-
12
- export { FileUpload, FileUpload as default };
10
+ };
11
+ export { FileUpload };
12
+ export default FileUpload;
package/dist/Slug.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- declare const makeSlug: (s: string, opt?: {
1
+ export declare const makeSlug: (s: string, opt?: {
2
2
  [key: string]: any;
3
3
  }) => string;
4
4
  declare const slug: {
5
5
  makeSlug: (s: string, opt?: {
6
6
  [key: string]: any;
7
7
  }) => string;
8
- };
9
-
10
- export { slug as default, makeSlug };
8
+ };
9
+ export default slug;
package/dist/Timer.d.ts CHANGED
@@ -1 +1,4 @@
1
- export { a as default } from './Timer-7b0c4e7c.js';
1
+ declare const Timer: {
2
+ wait: (ms: number) => Promise<unknown>;
3
+ };
4
+ export default Timer;
@@ -1,6 +1,5 @@
1
1
  declare const Validation: {
2
2
  imageValidate(file: Blob): boolean;
3
3
  videoValidate(file: Blob): boolean;
4
- };
5
-
6
- export { Validation as default };
4
+ };
5
+ export default Validation;
package/dist/array.d.ts CHANGED
@@ -1 +1,113 @@
1
- export { i as allMatchInArray, b as averageArray, x as default, f as firstElement, o as getHalfRandom, n as getRandom, l as lastElement, c as maxArray, h as mergeAndMakeUniqueElement, m as minArray, t as moveArray, q as moveIndex, g as randomElement, r as randomIndex, j as removeItem, k as removeItemByKey, p as shuffle, e as sortElementByNumber, d as sortElementByString, s as sumArray } from './array-dc599632.js';
1
+ export declare const sumArray: (array: [], key: string) => number;
2
+ /**
3
+ *
4
+ * @param {Array} array
5
+ * @param {string} key
6
+ * @returns {Number}
7
+ */
8
+ export declare const averageArray: (array: [], key: string) => number;
9
+ /**
10
+ *
11
+ * @param {Array} array
12
+ * @param {string} key
13
+ * @returns {Number}
14
+ */
15
+ export declare const minArray: (array: [], key: string) => number;
16
+ /**
17
+ *
18
+ * @param {Array} array
19
+ * @param {string} key
20
+ * @returns {Number}
21
+ */
22
+ export declare const maxArray: (array: [], key: string) => number;
23
+ /**
24
+ *
25
+ * @param {Array} array
26
+ * @param {string} key
27
+ * @returns {Array}
28
+ */
29
+ export declare const sortElementByString: (array: any, key: string) => any[] | undefined;
30
+ /**
31
+ *
32
+ * @param {Array} array
33
+ * @param {string} key
34
+ * @returns {Array}
35
+ */
36
+ export declare const sortElementByNumber: (array: any, key: string) => any[] | undefined;
37
+ /**
38
+ *
39
+ * @param {Array} array
40
+ * @returns {any}
41
+ */
42
+ export declare const firstElement: (array: any[]) => any;
43
+ /**
44
+ *
45
+ * @param {Array} array
46
+ * @returns {any}
47
+ */
48
+ export declare const lastElement: (array: any[]) => any;
49
+ /**
50
+ *
51
+ * @param {Array} array
52
+ * @returns {any}
53
+ */
54
+ export declare const randomIndex: (array: any[]) => number;
55
+ /**
56
+ *
57
+ * @param {Array} array
58
+ * @returns {any}
59
+ */
60
+ export declare const randomElement: (array: any[]) => any;
61
+ /**
62
+ * Remove same elements from 2 arrays
63
+ */
64
+ export declare const mergeAndMakeUniqueElement: (list1: any[], list2: any[], key: string) => any[] | undefined;
65
+ /**
66
+ * check target == toMatch
67
+ * @param {Array} target
68
+ * @param {Array} toMatch
69
+ * @returns {Boolean}
70
+ */
71
+ export declare const allMatchInArray: (target: any[], toMatch: any[]) => boolean;
72
+ export declare const removeItem: (item: any, array: any[]) => any[];
73
+ export declare const removeItemByKey: (key: string, value: any, array: any[]) => any[];
74
+ export declare const getRandom: (array: any[], n: number) => any[];
75
+ /**
76
+ * Get an array with shuffle element
77
+ */
78
+ export declare const getHalfRandom: (array: any[], n: number) => any[];
79
+ /**
80
+ * Make array shuffle itself
81
+ */
82
+ export 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
+ export declare const moveIndex: (array: any[], oldIndex: number, newIndex: number) => any[];
91
+ export declare const moveArray: (array: any[], oldIndex: number, newIndex: number) => any[];
92
+ declare const xarray: {
93
+ sumArray: (array: [], key: string) => number;
94
+ averageArray: (array: [], key: string) => number;
95
+ minArray: (array: [], key: string) => number;
96
+ maxArray: (array: [], key: string) => number;
97
+ sortElementByString: (array: any, key: string) => any[] | undefined;
98
+ sortElementByNumber: (array: any, key: string) => any[] | undefined;
99
+ firstElement: (array: any[]) => any;
100
+ lastElement: (array: any[]) => any;
101
+ randomIndex: (array: any[]) => number;
102
+ randomElement: (array: any[]) => any;
103
+ mergeAndMakeUniqueElement: (list1: any[], list2: any[], key: string) => any[] | undefined;
104
+ allMatchInArray: (target: any[], toMatch: any[]) => boolean;
105
+ removeItem: (item: any, array: any[]) => any[];
106
+ removeItemByKey: (key: string, value: any, array: any[]) => any[];
107
+ getRandom: (array: any[], n: number) => any[];
108
+ getHalfRandom: (array: any[], n: number) => any[];
109
+ shuffle: (array: any[]) => any[];
110
+ moveIndex: (array: any[], oldIndex: number, newIndex: number) => any[];
111
+ moveArray: (array: any[], oldIndex: number, newIndex: number) => any[];
112
+ };
113
+ export default xarray;
package/dist/color.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- declare const random: (hex?: boolean) => string;
2
- declare const pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
3
- declare const hexToRgb: (hex: string) => {
1
+ export declare const random: (hex?: boolean) => string;
2
+ export declare const pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
3
+ export declare const hexToRgb: (hex: string) => {
4
4
  r: number;
5
5
  g: number;
6
6
  b: number;
7
7
  } | null;
8
- declare const hexDarken: (hex: string, amount: number) => string | null;
9
- declare const hexLighten: (hex: string, amount: number) => string | null;
10
- declare const RGBToHex: (rgb: string | any) => string | null;
8
+ export declare const hexDarken: (hex: string, amount: number) => string | null;
9
+ export declare const hexLighten: (hex: string, amount: number) => string | null;
10
+ export declare const RGBToHex: (rgb: string | any) => string | null;
11
11
  declare const color: {
12
12
  random: (hex?: boolean) => string;
13
13
  pSBC: (p: any, c0: any, c1?: any, l?: any) => string | null;
@@ -19,6 +19,5 @@ declare const color: {
19
19
  hexDarken: (hex: string, amount: number) => string | null;
20
20
  hexLighten: (hex: string, amount: number) => string | null;
21
21
  RGBToHex: (rgb: string | any) => string | null;
22
- };
23
-
24
- export { RGBToHex, color as default, hexDarken, hexLighten, hexToRgb, pSBC, random };
22
+ };
23
+ export default color;
@@ -1 +1,2 @@
1
- export { a as default, a as enableConsole } from '../enableConsole-ddc24282.js';
1
+ export declare function enableConsole(): Console;
2
+ export default enableConsole;
@@ -1,2 +1,11 @@
1
- import '../enableConsole-ddc24282.js';
2
- export { x as default, d as disableConsole, r as removeConsole, s as showCredit } from '../index-1e114d55.js';
1
+ export declare const disableConsole: () => void;
2
+ export declare const removeConsole: () => void;
3
+ export declare const showCredit: () => void;
4
+ import { enableConsole } from "./enableConsole";
5
+ declare const xconsole: {
6
+ enableConsole: typeof enableConsole;
7
+ disableConsole: () => void;
8
+ removeConsole: () => void;
9
+ showCredit: () => void;
10
+ };
11
+ export default xconsole;
@@ -1,9 +1,9 @@
1
- declare const log: (...msg: any) => any;
2
- declare const logFull: (data?: {}) => {};
3
- declare const logRes: (res: any, ...msg: any[]) => any[];
4
- declare const logError: (...msg: any[]) => any[];
5
- declare const logWarn: (...msg: any[]) => any[];
6
- declare const logSuccess: (...msg: any[]) => any[];
1
+ export declare const log: (...msg: any) => any;
2
+ export declare const logFull: (data?: {}) => {};
3
+ export declare const logRes: (res: any, ...msg: any[]) => any[];
4
+ export declare const logError: (...msg: any[]) => any[];
5
+ export declare const logWarn: (...msg: any[]) => any[];
6
+ export declare const logSuccess: (...msg: any[]) => any[];
7
7
  declare const xlog: {
8
8
  log: (...msg: any) => any;
9
9
  logFull: (data?: {}) => {};
@@ -11,6 +11,5 @@ declare const xlog: {
11
11
  logError: (...msg: any[]) => any[];
12
12
  logWarn: (...msg: any[]) => any[];
13
13
  logSuccess: (...msg: any[]) => any[];
14
- };
15
-
16
- export { xlog as default, log, logError, logFull, logRes, logSuccess, logWarn };
14
+ };
15
+ export default xlog;
@@ -1 +1,5 @@
1
- export { c as isFacebookWebview, d as isInAppWebview, a as isLandscape, i as isPotrait, u as ua } from '../browser-8d042ffe.js';
1
+ export declare const isPotrait: () => boolean;
2
+ export declare const isLandscape: () => boolean;
3
+ export declare const ua: () => any;
4
+ export declare const isFacebookWebview: () => boolean | undefined;
5
+ export declare const isInAppWebview: () => boolean;
@@ -1 +1,7 @@
1
- export { g as getWebcam } from '../camera-1a859d72.js';
1
+ type GetWebcamParams = {
2
+ container?: HTMLElement;
3
+ facingMode: string;
4
+ audio: boolean;
5
+ };
6
+ export declare function getWebcam(params?: GetWebcamParams): Promise<unknown> | undefined;
7
+ export {};
@@ -1 +1,5 @@
1
- export { e as checkOS, a as isAndroid, i as isIos, c as isMobile, b as isTablet } from '../index-1f738e52.js';
1
+ export declare const isIos: () => boolean | null;
2
+ export declare const isAndroid: () => boolean | null;
3
+ export declare const isTablet: () => boolean | null;
4
+ export declare const isMobile: () => boolean | null;
5
+ export declare const checkOS: () => any;
@@ -1,12 +1,11 @@
1
- declare function getOS(): "aix" | "android" | "freebsd" | "haiku" | "linux" | "openbsd" | "sunos" | "cygwin" | "netbsd" | "mac" | "win";
2
- declare function isWin(): boolean;
3
- declare function isMac(): boolean;
4
- declare function isLinux(): boolean;
1
+ export declare function getOS(): "android" | "win" | "aix" | "freebsd" | "haiku" | "linux" | "openbsd" | "sunos" | "cygwin" | "netbsd" | "mac";
2
+ export declare function isWin(): boolean;
3
+ export declare function isMac(): boolean;
4
+ export declare function isLinux(): boolean;
5
5
  declare const _default: {
6
6
  getOS: typeof getOS;
7
7
  isWin: typeof isWin;
8
8
  isMac: typeof isMac;
9
9
  isLinux: typeof isLinux;
10
- };
11
-
12
- export { _default as default, getOS, isLinux, isMac, isWin };
10
+ };
11
+ export default _default;
@@ -1 +1,5 @@
1
- export { a as createDir } from '../createDir-220e0081.js';
1
+ /**
2
+ * Create new directory
3
+ */
4
+ declare function createDir(path: string): true | undefined;
5
+ export { createDir };
@@ -1 +1,4 @@
1
- export { a as fileMove } from '../fileMove-3a09e429.js';
1
+ /**
2
+ * Move file to another location.
3
+ */
4
+ export declare function fileMove(oldPath: string, newPath: string, callback: any): void;
@@ -1 +1,13 @@
1
- export { a as default, c as findFileByExt, b as forEachFileByExt } from '../findFilesByExt-753e91d7.js';
1
+ /**
2
+ * This is an alias of "findFileByExt()"
3
+ */
4
+ export declare const forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
5
+ /**
6
+ * This is an alias of "forEachFileByExt()"
7
+ */
8
+ export declare const findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
9
+ declare const fileExt: {
10
+ findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
11
+ forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
12
+ };
13
+ export default fileExt;
@@ -1,11 +1,9 @@
1
- import { a as createDir } from '../createDir-220e0081.js';
2
- import { a as fileMove } from '../fileMove-3a09e429.js';
3
-
1
+ import { createDir } from "./createDir";
2
+ import { fileMove } from "./fileMove";
4
3
  declare const xfile: {
5
4
  findFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
6
5
  forEachFileByExt: (base: string, ext: string, cb: (path: string) => {}) => void;
7
6
  createDir: typeof createDir;
8
7
  fileMove: typeof fileMove;
9
- };
10
-
11
- export { xfile as default };
8
+ };
9
+ export default xfile;
@@ -1,12 +1,10 @@
1
- import EventEmitter from 'events';
2
-
3
- declare class GameBoi extends EventEmitter {
1
+ /// <reference types="node" />
2
+ import EventEmitter from "events";
3
+ export default class GameBoi extends EventEmitter {
4
4
  #private;
5
5
  constructor();
6
6
  onConnect(e: GamepadEvent): void;
7
7
  onDisconnect(): void;
8
8
  gameLoop(): void;
9
9
  dispose(): void;
10
- }
11
-
12
- export { GameBoi as default };
10
+ }
@@ -1,2 +1,2 @@
1
- export { default as upload } from './upload.js';
2
- export { default as resize } from './resize.js';
1
+ export { upload } from "./upload";
2
+ export { resize } from "./resize";
@@ -1,3 +1 @@
1
- declare function loadImage(list: Array<string>): Promise<unknown[] | undefined>;
2
-
3
- export { loadImage as default };
1
+ export default function loadImage(list: Array<string>): Promise<unknown[] | undefined>;
@@ -1,3 +1,2 @@
1
- declare const resize: (file: File) => Promise<{} | undefined>;
2
-
3
- export { resize as default, resize };
1
+ export declare const resize: (file: File) => Promise<{} | undefined>;
2
+ export default resize;
@@ -1,4 +1,4 @@
1
- declare const upload: (file: File) => Promise<{
1
+ export declare const upload: (file: File) => Promise<{
2
2
  status: number;
3
3
  error: boolean;
4
4
  messages: any[];
@@ -6,6 +6,5 @@ declare const upload: (file: File) => Promise<{
6
6
  } | {
7
7
  blob: any;
8
8
  url: string;
9
- }>;
10
-
11
- export { upload as default, upload };
9
+ }>;
10
+ export default upload;
package/dist/index.d.ts CHANGED
@@ -1,30 +1,20 @@
1
- import { a as array } from './array-dc599632.js';
2
- import { d as device } from './index-1f738e52.js';
3
- import { c as console } from './index-1e114d55.js';
4
- import { b as browser } from './browser-8d042ffe.js';
5
- import { c as camera } from './camera-1a859d72.js';
6
- import { m as math } from './index-6ae3c86b.js';
7
- import { x as xname } from './index-22309f0c.js';
8
- import { o as object } from './object-43aaaf92.js';
9
- import { s as string } from './index-c52abc6d.js';
10
- import { u as url } from './url-4f3cd108.js';
11
- import { c as createDir } from './createDir-220e0081.js';
12
- import { f as fileMove } from './fileMove-3a09e429.js';
13
- import { f as findFilesByExt } from './findFilesByExt-753e91d7.js';
14
- import { T as Timer } from './Timer-7b0c4e7c.js';
15
- import { r as requestCamera } from './requestCamera-32b7dfc7.js';
16
- import { r as requestDeviceOrientationControl } from './requestDeviceOrientationControl-b6458660.js';
17
- import { e as enableConsole } from './enableConsole-ddc24282.js';
18
- import './math/diffDate.js';
19
- import './math/positiveNumber.js';
20
- import './name/en.js';
21
- import './name/vi.js';
22
- import './string/makeDaySlug.js';
23
- import './string/generateUUID.js';
24
- import './string/formatNumber.js';
25
- import './string/generatePassword.js';
26
- import './string/trimNull.js';
27
-
1
+ import * as array from "./array";
2
+ import * as device from "./device";
3
+ import * as console from "./console";
4
+ import * as browser from "./device/browser";
5
+ import * as camera from "./device/camera";
6
+ import * as math from "./math";
7
+ import * as xname from "./name";
8
+ import * as object from "./object";
9
+ import * as string from "./string";
10
+ import * as url from "./string/url";
11
+ import * as createDir from "./file/createDir";
12
+ import * as fileMove from "./file/fileMove";
13
+ import * as findFilesByExt from "./file/findFilesByExt";
14
+ import * as Timer from "./Timer";
15
+ import * as requestCamera from "./permission/requestCamera";
16
+ import * as requestDeviceOrientationControl from "./permission/requestDeviceOrientationControl";
17
+ import * as enableConsole from "./console/enableConsole";
28
18
  declare const utils: {
29
19
  xname: typeof xname;
30
20
  array: typeof array;
@@ -43,6 +33,5 @@ declare const utils: {
43
33
  requestCamera: typeof requestCamera;
44
34
  requestDeviceOrientationControl: typeof requestDeviceOrientationControl;
45
35
  enableConsole: typeof enableConsole;
46
- };
47
-
48
- export { utils as default };
36
+ };
37
+ export default utils;
package/dist/json.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Check if the object or string is in JSON format
3
3
  */
4
- declare const isValid: (content: object | string) => boolean;
4
+ export declare const isValid: (content: object | string) => boolean;
5
5
  declare const xjson: {
6
6
  isValid: (content: object | string) => boolean;
7
- };
8
-
9
- export { xjson as default, isValid };
7
+ };
8
+ export default xjson;
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Returns amount of different days between 2 dates
3
3
  */
4
- declare function diffDate(date1: string, date2: string): number;
5
-
6
- export { diffDate as default, diffDate };
4
+ export declare function diffDate(date1: string, date2: string): number;
5
+ export default diffDate;
@@ -1,3 +1,30 @@
1
- import './diffDate.js';
2
- import './positiveNumber.js';
3
- export { j as angleBetweenPoints, g as clamp, x as default, i as degBetweenPoints, h as degBetweenPoints360, e as degToRad, k as distance2Point, f as radToDeg, a as rand, d as randFloat, b as randHalt, c as randInt, r as randRound } from '../index-6ae3c86b.js';
1
+ export declare const randRound: (number: number) => number;
2
+ export declare const rand: (number: number) => number;
3
+ export declare const randHalt: (number: number) => number;
4
+ export declare const randInt: (low: number, high: number) => number;
5
+ export declare const randFloat: (low: number, high: number) => number;
6
+ export declare const degToRad: (degrees: number) => number;
7
+ export declare const radToDeg: (radians: number) => number;
8
+ export declare const clamp: (value: number, min: number, max: number) => number;
9
+ export declare const degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
10
+ export declare const degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
11
+ export declare const angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
12
+ export declare const distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
13
+ import { diffDate } from "./diffDate";
14
+ import { positiveNumber } from "./positiveNumber";
15
+ declare const xmath: {
16
+ rand: (number: number) => number;
17
+ randRound: (number: number) => number;
18
+ randHalt: (number: number) => number;
19
+ randInt: (low: number, high: number) => number;
20
+ randFloat: (low: number, high: number) => number;
21
+ degToRad: (degrees: number) => number;
22
+ radToDeg: (radians: number) => number;
23
+ degBetweenPoints360: (cx: number, cy: number, ex: number, ey: number) => number;
24
+ degBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
25
+ angleBetweenPoints: (cx: number, cy: number, ex: number, ey: number) => number;
26
+ distance2Point: (x1: number, y1: number, x2: number, y2: number) => number;
27
+ diffDate: typeof diffDate;
28
+ positiveNumber: typeof positiveNumber;
29
+ };
30
+ export default xmath;
@@ -1,3 +1,2 @@
1
- declare function positiveNumber(number: number): number;
2
-
3
- export { positiveNumber as default, positiveNumber };
1
+ export declare function positiveNumber(number: number): number;
2
+ export default positiveNumber;
package/dist/name/en.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- declare function generateName(): string;
1
+ export declare function generateName(): string;
2
2
  declare const NameEN: {
3
3
  generateName: typeof generateName;
4
- };
5
-
6
- export { NameEN as default, generateName };
4
+ };
5
+ export default NameEN;
@@ -1,3 +1,12 @@
1
- export { default as NameEN } from './en.js';
2
- export { default as NameVI } from './vi.js';
3
- export { a as default } from '../index-22309f0c.js';
1
+ import NameEN from "./en";
2
+ import NameVI from "./vi";
3
+ export { NameEN, NameVI };
4
+ declare const xname: {
5
+ NameEN: {
6
+ generateName: typeof import("./en").generateName;
7
+ };
8
+ NameVI: {
9
+ generateName: (useGender?: boolean, male?: boolean) => any;
10
+ };
11
+ };
12
+ export default xname;
package/dist/name/vi.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- declare const generateName: (useGender?: boolean, male?: boolean) => any;
1
+ export declare const generateName: (useGender?: boolean, male?: boolean) => any;
2
2
  declare const NameVI: {
3
3
  generateName: (useGender?: boolean, male?: boolean) => any;
4
- };
5
-
6
- export { NameVI as default, generateName };
4
+ };
5
+ export default NameVI;
package/dist/object.d.ts CHANGED
@@ -1 +1,59 @@
1
- export { x as default, i as isNull, e as iterate, d as objectToArray, c as toArray, t as toBool, b as toFloat, a as toInt } from './object-43aaaf92.js';
1
+ export declare const isNull: (object: string | number | {
2
+ [key: string]: any;
3
+ }) => boolean;
4
+ export declare const toBool: (object: string | {
5
+ [key: string]: any;
6
+ } | null) => boolean;
7
+ export declare const toInt: (object: string | number | {
8
+ [key: string]: any;
9
+ } | null) => number;
10
+ export declare const toFloat: (object: string | {
11
+ [key: string]: any;
12
+ } | null) => number;
13
+ export declare const toArray: (obj: {
14
+ [key: string]: any;
15
+ }) => {
16
+ [key: string]: any;
17
+ };
18
+ /**
19
+ * Convert value in object to array
20
+ */
21
+ export declare const objectToArray: (obj: {
22
+ [key: string]: any;
23
+ }) => any[];
24
+ /**
25
+ * Iterate through every keys & values of the object
26
+ */
27
+ export declare const iterate: (obj: {
28
+ [key: string]: any;
29
+ }, callbackFn: (obj: any, key?: string, value?: any) => any) => {
30
+ [key: string]: any;
31
+ };
32
+ declare const xobject: {
33
+ isNull: (object: string | number | {
34
+ [key: string]: any;
35
+ }) => boolean;
36
+ toBool: (object: string | {
37
+ [key: string]: any;
38
+ } | null) => boolean;
39
+ toInt: (object: string | number | {
40
+ [key: string]: any;
41
+ } | null) => number;
42
+ toFloat: (object: string | {
43
+ [key: string]: any;
44
+ } | null) => number;
45
+ toArray: (obj: {
46
+ [key: string]: any;
47
+ }) => {
48
+ [key: string]: any;
49
+ };
50
+ objectToArray: (obj: {
51
+ [key: string]: any;
52
+ }) => any[];
53
+ iterate: (obj: {
54
+ [key: string]: any;
55
+ }, callbackFn: (obj: any, key?: string, value?: any) => any) => {
56
+ [key: string]: any;
57
+ };
58
+ };
59
+ export default xobject;
@@ -4,6 +4,5 @@ declare const permission: {
4
4
  video?: boolean | undefined;
5
5
  }) => false | Promise<unknown>;
6
6
  requestDeviceOrientationControl: () => false | Promise<unknown>;
7
- };
8
-
9
- export { permission as default };
7
+ };
8
+ export default permission;
@@ -1 +1,5 @@
1
- export { a as default, a as requestCamera } from '../requestCamera-32b7dfc7.js';
1
+ export declare const requestCamera: ({ audio, video }: {
2
+ audio?: boolean | undefined;
3
+ video?: boolean | undefined;
4
+ }) => false | Promise<unknown>;
5
+ export default requestCamera;
@@ -1 +1,2 @@
1
- export { a as default, a as requestDeviceOrientationControl } from '../requestDeviceOrientationControl-b6458660.js';
1
+ export declare const requestDeviceOrientationControl: () => false | Promise<unknown>;
2
+ export default requestDeviceOrientationControl;
@@ -1,20 +1,20 @@
1
- declare const getResponse: () => {
1
+ export declare const getResponse: () => {
2
2
  status: number;
3
3
  messages: never[];
4
4
  data: {};
5
5
  };
6
- declare const getSuccessResponse: (data: any, message?: string) => {
6
+ export declare const getSuccessResponse: (data: any, message?: string) => {
7
7
  status: number;
8
8
  messages: string[];
9
9
  data: any;
10
10
  };
11
- declare const getFailedResponse: (...messages: any[]) => {
11
+ export declare const getFailedResponse: (...messages: any[]) => {
12
12
  status: number;
13
13
  error: boolean;
14
14
  messages: any[];
15
15
  data: {};
16
16
  };
17
- declare const Response: {
17
+ export declare const Response: {
18
18
  send: (res: any, data?: any) => any;
19
19
  succeed: (res: any, data?: any) => any;
20
20
  failed: (res: any, ...messages: string[]) => any;
@@ -45,6 +45,5 @@ declare const response: {
45
45
  rejected: (res: any, message?: string) => any;
46
46
  ignore: (res: any, message?: string) => any;
47
47
  };
48
- };
49
-
50
- export { Response, response as default, getFailedResponse, getResponse, getSuccessResponse };
48
+ };
49
+ export default response;
@@ -1,6 +1,4 @@
1
- declare function convertPathnameAndQuery(url: string): {
1
+ export default function convertPathnameAndQuery(url: string): {
2
2
  pathname: string;
3
3
  query: any;
4
- };
5
-
6
- export { convertPathnameAndQuery as default };
4
+ } | null;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const object_1 = require("../object");
3
4
  function convertPathnameAndQuery(url) {
4
5
  //
6
+ if ((0, object_1.isNull)(url))
7
+ return null;
8
+ url = url.toString();
5
9
  const arr = url.split("?");
6
10
  const pathname = arr[0];
7
11
  const query = {};
@@ -1 +1 @@
1
- {"version":3,"file":"convertPathnameAndQuery.js","sourceRoot":"","sources":["../../src/string/convertPathnameAndQuery.ts"],"names":[],"mappings":";;AAAA,SAAwB,uBAAuB,CAAC,GAAW;IAC1D,EAAE;IAEF,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAS,CAAC;IAExB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;KACH;IAED,OAAO;QACN,QAAQ;QACR,KAAK;KACL,CAAC;AACH,CAAC;AApBD,0CAoBC"}
1
+ {"version":3,"file":"convertPathnameAndQuery.js","sourceRoot":"","sources":["../../src/string/convertPathnameAndQuery.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,SAAwB,uBAAuB,CAAC,GAAW;IAC1D,EAAE;IACF,IAAI,IAAA,eAAM,EAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAErB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAS,CAAC;IAExB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;KACH;IAED,OAAO;QACN,QAAQ;QACR,KAAK;KACL,CAAC;AACH,CAAC;AAtBD,0CAsBC"}
@@ -2,6 +2,5 @@
2
2
  * Format the input number with commas
3
3
  * @example 1000000 -> 1,000,000
4
4
  */
5
- declare function formatNumber(num: number, prefix?: string): string;
6
-
7
- export { formatNumber as default, formatNumber };
5
+ export declare function formatNumber(num: number, prefix?: string): string;
6
+ export default formatNumber;
@@ -5,6 +5,5 @@
5
5
  * @param {Boolean} hard
6
6
  * @returns
7
7
  */
8
- declare function generatePassword(length?: number, hard?: boolean): string;
9
-
10
- export { generatePassword as default, generatePassword };
8
+ export declare function generatePassword(length?: number, hard?: boolean): string;
9
+ export default generatePassword;
@@ -1,3 +1,2 @@
1
- declare function generateUUID(): string;
2
-
3
- export { generateUUID as default, generateUUID };
1
+ export declare function generateUUID(): string;
2
+ export default generateUUID;
@@ -1,3 +1 @@
1
- declare function getTextBetweenCharByIndex(str: string, char: any, index: Number): string;
2
-
3
- export { getTextBetweenCharByIndex as default };
1
+ export default function getTextBetweenCharByIndex(str: string, char: any, index: Number): string;
@@ -1,6 +1,65 @@
1
- import './makeDaySlug.js';
2
- import './generateUUID.js';
3
- import './formatNumber.js';
4
- import './generatePassword.js';
5
- import './trimNull.js';
6
- export { c as capitalize, d as capitalizeName, e as clearUnicodeCharacters, x as default, g as getBetween, m as makeString, b as titleize, a as toLowerCase, t as toUpperCase } from '../index-c52abc6d.js';
1
+ /**
2
+ * Get string between str1 and str2 from text
3
+ */
4
+ export declare const getBetween: (text: string, str1: string, str2?: string) => string;
5
+ /**
6
+ * Convert object to string
7
+ */
8
+ export declare const makeString: (object?: any) => string;
9
+ /**
10
+ * toUpperCase
11
+ */
12
+ export declare const toUpperCase: (str?: string) => string;
13
+ /**
14
+ * toLowerCase
15
+ */
16
+ export declare const toLowerCase: (str?: string) => string;
17
+ /**
18
+ * toLowerCase
19
+ * @param {*} str
20
+ * @return {string}
21
+ */
22
+ export declare const titleize: (str?: string) => string;
23
+ /**
24
+ * Convert only first charater to UpperCase
25
+ */
26
+ export declare const capitalize: (str: string | any, lowercaseRest?: number) => any;
27
+ /**
28
+ * Convert first character from every single words to UpperCase
29
+ */
30
+ export declare const capitalizeName: (str: string) => string;
31
+ export declare const clearUnicodeCharacters: (s: string, opt?: {
32
+ [key: string]: any;
33
+ }) => string;
34
+ import { makeDaySlug } from "./makeDaySlug";
35
+ import { generateUUID } from "./generateUUID";
36
+ import { formatNumber } from "./formatNumber";
37
+ import { generatePassword } from "./generatePassword";
38
+ import { trimNull } from "./trimNull";
39
+ declare const xstring: {
40
+ getBetween: (text: string, str1: string, str2?: string) => string;
41
+ makeString: (object?: any) => string;
42
+ makeDaySlug: typeof makeDaySlug;
43
+ toUpperCase: (str?: string) => string;
44
+ toLowerCase: (str?: string) => string;
45
+ titleize: (str?: string) => string;
46
+ capitalize: (str: string | any, lowercaseRest?: number) => any;
47
+ capitalizeName: (str: string) => string;
48
+ clearUnicodeCharacters: (s: string, opt?: {
49
+ [key: string]: any;
50
+ }) => string;
51
+ generateUUID: typeof generateUUID;
52
+ randAllCharacterByLength: (length?: number) => string;
53
+ randomStringByLength: (length: number, str?: string) => string;
54
+ formatNumber: typeof formatNumber;
55
+ generatePassword: typeof generatePassword;
56
+ trimNull: typeof trimNull;
57
+ addQueryParam: (_url: string, key: string, value: any) => string;
58
+ getUrlParams: (parameter: string, staticURL?: string | undefined, decode?: boolean) => string | false | undefined;
59
+ isLink: (str: string) => boolean;
60
+ getFileNameWithoutExtension: (url: string) => string;
61
+ getFileNameWithExtension: (url: string) => string;
62
+ getFileExtension: (url: string) => string | undefined;
63
+ isImage: (url: string) => boolean;
64
+ };
65
+ export default xstring;
@@ -1,3 +1 @@
1
- declare function indexesOf(str: string, regex: any): any[];
2
-
3
- export { indexesOf as default };
1
+ export default function indexesOf(str: string, regex: any): any[];
@@ -24,9 +24,8 @@ type DaySlugOptions = {
24
24
  * Format the input number with commas
25
25
  * @example 1000000 -> 1,000,000
26
26
  */
27
- declare function makeDaySlug(options?: DaySlugOptions): string;
27
+ export declare function makeDaySlug(options?: DaySlugOptions): string;
28
28
  declare const _default: {
29
29
  makeDaySlug: typeof makeDaySlug;
30
- };
31
-
32
- export { _default as default, makeDaySlug };
30
+ };
31
+ export default _default;
@@ -1,17 +1,16 @@
1
- declare const textLowCase = "abcdefghijklmnopqrstuvwxyz";
2
- declare const numeric = "0123456789";
3
- declare const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
4
- declare const allCharacter = "\u0111\u0110a\u00E1\u00E0\u1EA3\u00E3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u00E2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\u00E9\u00E8\u1EBB\u1EBD\u1EB9\u00EA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\u00F3\u00F2\u1ECF\u00F5\u1ECD\u00F4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\u00ED\u00EC\u1EC9\u0129\u1ECBu\u00FA\u00F9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\u00FD\u1EF3\u1EF7\u1EF9\u1EF5A\u00C1\u00C0\u1EA2\u00C3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u00C2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\u00C9\u00C8\u1EBA\u1EBC\u1EB8\u00CA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\u00D3\u00D2\u1ECE\u00D5\u1ECC\u00D4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\u00CD\u00CC\u1EC8\u0128\u1ECAU\u00DA\u00D9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\u00DD\u1EF2 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}";
1
+ export declare const textLowCase = "abcdefghijklmnopqrstuvwxyz";
2
+ export declare const numeric = "0123456789";
3
+ export declare const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
4
+ export declare const allCharacter = "\u0111\u0110a\u00E1\u00E0\u1EA3\u00E3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u00E2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\u00E9\u00E8\u1EBB\u1EBD\u1EB9\u00EA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\u00F3\u00F2\u1ECF\u00F5\u1ECD\u00F4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\u00ED\u00EC\u1EC9\u0129\u1ECBu\u00FA\u00F9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\u00FD\u1EF3\u1EF7\u1EF9\u1EF5A\u00C1\u00C0\u1EA2\u00C3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u00C2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\u00C9\u00C8\u1EBA\u1EBC\u1EB8\u00CA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\u00D3\u00D2\u1ECE\u00D5\u1ECC\u00D4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\u00CD\u00CC\u1EC8\u0128\u1ECAU\u00DA\u00D9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\u00DD\u1EF2 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}";
5
5
  /**
6
6
  * allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
7
7
  */
8
- declare const randAllCharacterByLength: (length?: number) => string;
9
- declare const randomStringByLength: (length: number, str?: string) => string;
10
- declare const randomStringAndNumberByLength: (length: number, str?: string) => string;
8
+ export declare const randAllCharacterByLength: (length?: number) => string;
9
+ export declare const randomStringByLength: (length: number, str?: string) => string;
10
+ export declare const randomStringAndNumberByLength: (length: number, str?: string) => string;
11
11
  declare const random: {
12
12
  randAllCharacterByLength: (length?: number) => string;
13
13
  randomStringByLength: (length: number, str?: string) => string;
14
14
  randomStringAndNumberByLength: (length: number, str?: string) => string;
15
- };
16
-
17
- export { allCharacter, random as default, numeric, punctuation, randAllCharacterByLength, randomStringAndNumberByLength, randomStringByLength, textLowCase };
15
+ };
16
+ export default random;
@@ -1,3 +1,2 @@
1
- declare function trimNull(str: string): string;
2
-
3
- export { trimNull as default, trimNull };
1
+ export declare function trimNull(str: string): string;
2
+ export default trimNull;
@@ -1 +1,27 @@
1
- export { a as addQueryParam, x as default, d as getFileExtension, c as getFileNameWithExtension, b as getFileNameWithoutExtension, g as getUrlParams, e as isImage, i as isLink } from '../url-4f3cd108.js';
1
+ export declare const addQueryParam: (_url: string, key: string, value: any) => string;
2
+ export declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
3
+ export declare const isLink: (str: string) => boolean;
4
+ export declare const getFileNameWithoutExtension: (url: string) => string;
5
+ export declare const getFileNameWithExtension: (url: string) => string;
6
+ /**
7
+ *
8
+ * @param {string} url
9
+ * @return {string}
10
+ */
11
+ export declare const getFileExtension: (url: string) => string | undefined;
12
+ /**
13
+ *
14
+ * @param {string} url
15
+ * @returns
16
+ */
17
+ export declare const isImage: (url: string) => boolean;
18
+ declare const xurl: {
19
+ addQueryParam: (_url: string, key: string, value: any) => string;
20
+ getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
21
+ isLink: (str: string) => boolean;
22
+ getFileNameWithoutExtension: (url: string) => string;
23
+ getFileNameWithExtension: (url: string) => string;
24
+ getFileExtension: (url: string) => string | undefined;
25
+ isImage: (url: string) => boolean;
26
+ };
27
+ export default xurl;
@@ -1,4 +1,4 @@
1
1
  export default function convertPathnameAndQuery(url: string): {
2
2
  pathname: string;
3
3
  query: any;
4
- };
4
+ } | null;
@@ -1,5 +1,9 @@
1
+ import { isNull } from "../object";
1
2
  export default function convertPathnameAndQuery(url) {
2
3
  //
4
+ if (isNull(url))
5
+ return null;
6
+ url = url.toString();
3
7
  const arr = url.split("?");
4
8
  const pathname = arr[0];
5
9
  const query = {};
@@ -1 +1 @@
1
- {"version":3,"file":"convertPathnameAndQuery.js","sourceRoot":"","sources":["../../src/string/convertPathnameAndQuery.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,GAAW;IAC1D,EAAE;IAEF,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAS,CAAC;IAExB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;KACH;IAED,OAAO;QACN,QAAQ;QACR,KAAK;KACL,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"convertPathnameAndQuery.js","sourceRoot":"","sources":["../../src/string/convertPathnameAndQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,GAAW;IAC1D,EAAE;IACF,IAAI,MAAM,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAErB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAS,CAAC;IAExB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;QACX,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;KACH;IAED,OAAO;QACN,QAAQ;QACR,KAAK;KACL,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginext-utils",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "sideEffects": false,
5
5
  "readme": "README.md",
6
6
  "homepage": "https://wearetopgroup.com",
@@ -1,5 +1,8 @@
1
+ import { isNull } from "../object";
1
2
  export default function convertPathnameAndQuery(url: string) {
2
3
  //
4
+ if (isNull(url)) return null;
5
+ url = url.toString();
3
6
 
4
7
  const arr = url.split("?");
5
8