diginext-utils 2.1.17 → 2.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/Checker.d.ts +0 -8
- package/dist/Checker.js +0 -32
- package/dist/Checker.js.map +0 -1
- package/dist/EventDispatcher.d.ts +0 -13
- package/dist/EventDispatcher.js +0 -52
- package/dist/EventDispatcher.js.map +0 -1
- package/dist/FileUpload.d.ts +0 -12
- package/dist/FileUpload.js +0 -65
- package/dist/FileUpload.js.map +0 -1
- package/dist/Slug.d.ts +0 -9
- package/dist/Slug.js +0 -334
- package/dist/Slug.js.map +0 -1
- package/dist/Timer.d.ts +0 -4
- package/dist/Timer.js +0 -9
- package/dist/Timer.js.map +0 -1
- package/dist/Validation.d.ts +0 -5
- package/dist/Validation.js +0 -39
- package/dist/Validation.js.map +0 -1
- package/dist/array.d.ts +0 -113
- package/dist/array.js +0 -298
- package/dist/array.js.map +0 -1
- package/dist/color.d.ts +0 -25
- package/dist/color.js +0 -95
- package/dist/color.js.map +0 -1
- package/dist/console/enableConsole.d.ts +0 -2
- package/dist/console/enableConsole.js +0 -14
- package/dist/console/enableConsole.js.map +0 -1
- package/dist/console/index.d.ts +0 -11
- package/dist/console/index.js +0 -18
- package/dist/console/index.js.map +0 -1
- package/dist/console/log.d.ts +0 -15
- package/dist/console/log.js +0 -45
- package/dist/console/log.js.map +0 -1
- package/dist/device/browser.d.ts +0 -5
- package/dist/device/browser.js +0 -38
- package/dist/device/browser.js.map +0 -1
- package/dist/device/camera.d.ts +0 -7
- package/dist/device/camera.js +0 -172
- package/dist/device/camera.js.map +0 -1
- package/dist/device/index.d.ts +0 -5
- package/dist/device/index.js +0 -225
- package/dist/device/index.js.map +0 -1
- package/dist/device/os.d.ts +0 -11
- package/dist/device/os.js +0 -38
- package/dist/device/os.js.map +0 -1
- package/dist/file/createDir.d.ts +0 -5
- package/dist/file/createDir.js +0 -16
- package/dist/file/createDir.js.map +0 -1
- package/dist/file/fileMove.d.ts +0 -4
- package/dist/file/fileMove.js +0 -33
- package/dist/file/fileMove.js.map +0 -1
- package/dist/file/findFilesByExt.d.ts +0 -13
- package/dist/file/findFilesByExt.js +0 -50
- package/dist/file/findFilesByExt.js.map +0 -1
- package/dist/file/index.d.ts +0 -9
- package/dist/file/index.js +0 -11
- package/dist/file/index.js.map +0 -1
- package/dist/gameboi/index.d.ts +0 -10
- package/dist/gameboi/index.js +0 -68
- package/dist/gameboi/index.js.map +0 -1
- package/dist/images/downloadByUrl.d.ts +0 -1
- package/dist/images/downloadByUrl.js +0 -56
- package/dist/images/downloadByUrl.js.map +0 -1
- package/dist/images/index.d.ts +0 -2
- package/dist/images/index.js +0 -9
- package/dist/images/index.js.map +0 -1
- package/dist/images/loadImage.d.ts +0 -1
- package/dist/images/loadImage.js +0 -18
- package/dist/images/loadImage.js.map +0 -1
- package/dist/images/resize.d.ts +0 -2
- package/dist/images/resize.js +0 -38
- package/dist/images/resize.js.map +0 -1
- package/dist/images/upload.d.ts +0 -10
- package/dist/images/upload.js +0 -27
- package/dist/images/upload.js.map +0 -1
- package/dist/index.d.ts +0 -37
- package/dist/index.js +0 -63
- package/dist/index.js.map +0 -1
- package/dist/json.d.ts +0 -8
- package/dist/json.js +0 -32
- package/dist/json.js.map +0 -1
- package/dist/math/diffDate.d.ts +0 -5
- package/dist/math/diffDate.js +0 -14
- package/dist/math/diffDate.js.map +0 -1
- package/dist/math/index.d.ts +0 -30
- package/dist/math/index.js +0 -93
- package/dist/math/index.js.map +0 -1
- package/dist/math/positiveNumber.d.ts +0 -2
- package/dist/math/positiveNumber.js +0 -17
- package/dist/math/positiveNumber.js.map +0 -1
- package/dist/name/en.d.ts +0 -5
- package/dist/name/en.js +0 -26
- package/dist/name/en.js.map +0 -1
- package/dist/name/index.d.ts +0 -12
- package/dist/name/index.js +0 -13
- package/dist/name/index.js.map +0 -1
- package/dist/name/vi.d.ts +0 -5
- package/dist/name/vi.js +0 -28
- package/dist/name/vi.js.map +0 -1
- package/dist/object.d.ts +0 -59
- package/dist/object.js +0 -80
- package/dist/object.js.map +0 -1
- package/dist/permission/index.d.ts +0 -8
- package/dist/permission/index.js +0 -7
- package/dist/permission/index.js.map +0 -1
- package/dist/permission/requestCamera.d.ts +0 -5
- package/dist/permission/requestCamera.js +0 -43
- package/dist/permission/requestCamera.js.map +0 -1
- package/dist/permission/requestDeviceOrientationControl.d.ts +0 -2
- package/dist/permission/requestDeviceOrientationControl.js +0 -39
- package/dist/permission/requestDeviceOrientationControl.js.map +0 -1
- package/dist/response/index.d.ts +0 -49
- package/dist/response/index.js +0 -52
- package/dist/response/index.js.map +0 -1
- package/dist/string/convertPathnameAndQuery.d.ts +0 -4
- package/dist/string/convertPathnameAndQuery.js +0 -25
- package/dist/string/convertPathnameAndQuery.js.map +0 -1
- package/dist/string/formatNumber.d.ts +0 -6
- package/dist/string/formatNumber.js +0 -15
- package/dist/string/formatNumber.js.map +0 -1
- package/dist/string/generatePassword.d.ts +0 -9
- package/dist/string/generatePassword.js +0 -24
- package/dist/string/generatePassword.js.map +0 -1
- package/dist/string/generateUUID.d.ts +0 -2
- package/dist/string/generateUUID.js +0 -37
- package/dist/string/generateUUID.js.map +0 -1
- package/dist/string/getTextBetweenCharByIndex.d.ts +0 -1
- package/dist/string/getTextBetweenCharByIndex.js +0 -21
- package/dist/string/getTextBetweenCharByIndex.js.map +0 -1
- package/dist/string/index.d.ts +0 -65
- package/dist/string/index.js +0 -162
- package/dist/string/index.js.map +0 -1
- package/dist/string/indexesOf.d.ts +0 -1
- package/dist/string/indexesOf.js +0 -15
- package/dist/string/indexesOf.js.map +0 -1
- package/dist/string/makeDaySlug.d.ts +0 -31
- package/dist/string/makeDaySlug.js +0 -23
- package/dist/string/makeDaySlug.js.map +0 -1
- package/dist/string/random.d.ts +0 -18
- package/dist/string/random.js +0 -41
- package/dist/string/random.js.map +0 -1
- package/dist/string/trimNull.d.ts +0 -2
- package/dist/string/trimNull.js +0 -21
- package/dist/string/trimNull.js.map +0 -1
- package/dist/string/url.d.ts +0 -22
- package/dist/string/url.js +0 -75
- package/dist/string/url.js.map +0 -1
- package/esm/Checker.d.ts +0 -8
- package/esm/Checker.js +0 -28
- package/esm/Checker.js.map +0 -1
- package/esm/EventDispatcher.d.ts +0 -13
- package/esm/EventDispatcher.js +0 -49
- package/esm/EventDispatcher.js.map +0 -1
- package/esm/FileUpload.d.ts +0 -12
- package/esm/FileUpload.js +0 -62
- package/esm/FileUpload.js.map +0 -1
- package/esm/Slug.d.ts +0 -9
- package/esm/Slug.js +0 -330
- package/esm/Slug.js.map +0 -1
- package/esm/Timer.d.ts +0 -4
- package/esm/Timer.js +0 -7
- package/esm/Timer.js.map +0 -1
- package/esm/Validation.d.ts +0 -5
- package/esm/Validation.js +0 -37
- package/esm/Validation.js.map +0 -1
- package/esm/array.d.ts +0 -113
- package/esm/array.js +0 -276
- package/esm/array.js.map +0 -1
- package/esm/color.d.ts +0 -25
- package/esm/color.js +0 -85
- package/esm/color.js.map +0 -1
- package/esm/console/enableConsole.d.ts +0 -2
- package/esm/console/enableConsole.js +0 -7
- package/esm/console/enableConsole.js.map +0 -1
- package/esm/console/index.d.ts +0 -11
- package/esm/console/index.js +0 -13
- package/esm/console/index.js.map +0 -1
- package/esm/console/log.d.ts +0 -15
- package/esm/console/log.js +0 -33
- package/esm/console/log.js.map +0 -1
- package/esm/device/browser.d.ts +0 -5
- package/esm/device/browser.js +0 -30
- package/esm/device/browser.js.map +0 -1
- package/esm/device/camera.d.ts +0 -7
- package/esm/device/camera.js +0 -168
- package/esm/device/camera.js.map +0 -1
- package/esm/device/index.d.ts +0 -5
- package/esm/device/index.js +0 -217
- package/esm/device/index.js.map +0 -1
- package/esm/device/os.d.ts +0 -11
- package/esm/device/os.js +0 -28
- package/esm/device/os.js.map +0 -1
- package/esm/file/createDir.d.ts +0 -5
- package/esm/file/createDir.js +0 -13
- package/esm/file/createDir.js.map +0 -1
- package/esm/file/fileMove.d.ts +0 -4
- package/esm/file/fileMove.js +0 -29
- package/esm/file/fileMove.js.map +0 -1
- package/esm/file/findFilesByExt.d.ts +0 -13
- package/esm/file/findFilesByExt.js +0 -46
- package/esm/file/findFilesByExt.js.map +0 -1
- package/esm/file/index.d.ts +0 -9
- package/esm/file/index.js +0 -6
- package/esm/file/index.js.map +0 -1
- package/esm/gameboi/index.d.ts +0 -10
- package/esm/gameboi/index.js +0 -62
- package/esm/gameboi/index.js.map +0 -1
- package/esm/images/downloadByUrl.d.ts +0 -1
- package/esm/images/downloadByUrl.js +0 -53
- package/esm/images/downloadByUrl.js.map +0 -1
- package/esm/images/index.d.ts +0 -2
- package/esm/images/index.js +0 -4
- package/esm/images/index.js.map +0 -1
- package/esm/images/loadImage.d.ts +0 -1
- package/esm/images/loadImage.js +0 -15
- package/esm/images/loadImage.js.map +0 -1
- package/esm/images/resize.d.ts +0 -2
- package/esm/images/resize.js +0 -31
- package/esm/images/resize.js.map +0 -1
- package/esm/images/upload.d.ts +0 -10
- package/esm/images/upload.js +0 -20
- package/esm/images/upload.js.map +0 -1
- package/esm/index.d.ts +0 -37
- package/esm/index.js +0 -38
- package/esm/index.js.map +0 -1
- package/esm/json.d.ts +0 -8
- package/esm/json.js +0 -28
- package/esm/json.js.map +0 -1
- package/esm/math/diffDate.d.ts +0 -5
- package/esm/math/diffDate.js +0 -10
- package/esm/math/diffDate.js.map +0 -1
- package/esm/math/index.d.ts +0 -30
- package/esm/math/index.js +0 -78
- package/esm/math/index.js.map +0 -1
- package/esm/math/positiveNumber.d.ts +0 -2
- package/esm/math/positiveNumber.js +0 -13
- package/esm/math/positiveNumber.js.map +0 -1
- package/esm/name/en.d.ts +0 -5
- package/esm/name/en.js +0 -22
- package/esm/name/en.js.map +0 -1
- package/esm/name/index.d.ts +0 -12
- package/esm/name/index.js +0 -6
- package/esm/name/index.js.map +0 -1
- package/esm/name/vi.d.ts +0 -5
- package/esm/name/vi.js +0 -24
- package/esm/name/vi.js.map +0 -1
- package/esm/object.d.ts +0 -59
- package/esm/object.js +0 -70
- package/esm/object.js.map +0 -1
- package/esm/permission/index.d.ts +0 -8
- package/esm/permission/index.js +0 -5
- package/esm/permission/index.js.map +0 -1
- package/esm/permission/requestCamera.d.ts +0 -5
- package/esm/permission/requestCamera.js +0 -39
- package/esm/permission/requestCamera.js.map +0 -1
- package/esm/permission/requestDeviceOrientationControl.d.ts +0 -2
- package/esm/permission/requestDeviceOrientationControl.js +0 -35
- package/esm/permission/requestDeviceOrientationControl.js.map +0 -1
- package/esm/response/index.d.ts +0 -49
- package/esm/response/index.js +0 -46
- package/esm/response/index.js.map +0 -1
- package/esm/string/convertPathnameAndQuery.d.ts +0 -4
- package/esm/string/convertPathnameAndQuery.js +0 -22
- package/esm/string/convertPathnameAndQuery.js.map +0 -1
- package/esm/string/formatNumber.d.ts +0 -6
- package/esm/string/formatNumber.js +0 -11
- package/esm/string/formatNumber.js.map +0 -1
- package/esm/string/generatePassword.d.ts +0 -9
- package/esm/string/generatePassword.js +0 -20
- package/esm/string/generatePassword.js.map +0 -1
- package/esm/string/generateUUID.d.ts +0 -2
- package/esm/string/generateUUID.js +0 -33
- package/esm/string/generateUUID.js.map +0 -1
- package/esm/string/getTextBetweenCharByIndex.d.ts +0 -1
- package/esm/string/getTextBetweenCharByIndex.js +0 -15
- package/esm/string/getTextBetweenCharByIndex.js.map +0 -1
- package/esm/string/index.d.ts +0 -65
- package/esm/string/index.js +0 -151
- package/esm/string/index.js.map +0 -1
- package/esm/string/indexesOf.d.ts +0 -1
- package/esm/string/indexesOf.js +0 -12
- package/esm/string/indexesOf.js.map +0 -1
- package/esm/string/makeDaySlug.d.ts +0 -31
- package/esm/string/makeDaySlug.js +0 -16
- package/esm/string/makeDaySlug.js.map +0 -1
- package/esm/string/random.d.ts +0 -18
- package/esm/string/random.js +0 -34
- package/esm/string/random.js.map +0 -1
- package/esm/string/trimNull.d.ts +0 -2
- package/esm/string/trimNull.js +0 -14
- package/esm/string/trimNull.js.map +0 -1
- package/esm/string/url.d.ts +0 -22
- package/esm/string/url.js +0 -65
- package/esm/string/url.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexesOf.js","sourceRoot":"","sources":["../../src/string/indexesOf.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,GAAW,EAAE,KAAU;IACxD,IAAI,KAAU,EACb,OAAO,GAAG,EAAS,CAAC;IAErB,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;QACjC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QAC/C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACvB;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
type DaySlugOptions = {
|
|
2
|
-
/**
|
|
3
|
-
* @default ""
|
|
4
|
-
*/
|
|
5
|
-
prefix?: string;
|
|
6
|
-
/**
|
|
7
|
-
* @default ""
|
|
8
|
-
*/
|
|
9
|
-
surfix?: string;
|
|
10
|
-
/**
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
useDate?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* @default true
|
|
16
|
-
*/
|
|
17
|
-
useTime?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @default "-"
|
|
20
|
-
*/
|
|
21
|
-
divider?: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Format the input number with commas
|
|
25
|
-
* @example 1000000 -> 1,000,000
|
|
26
|
-
*/
|
|
27
|
-
export declare function makeDaySlug(options?: DaySlugOptions): string;
|
|
28
|
-
declare const _default: {
|
|
29
|
-
makeDaySlug: typeof makeDaySlug;
|
|
30
|
-
};
|
|
31
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
/**
|
|
3
|
-
* Format the input number with commas
|
|
4
|
-
* @example 1000000 -> 1,000,000
|
|
5
|
-
*/
|
|
6
|
-
export function makeDaySlug(options = {}) {
|
|
7
|
-
const { prefix = "", surfix = "", divider = "-", useDate = true, useTime = true } = options;
|
|
8
|
-
let mainStr = "";
|
|
9
|
-
if (useDate)
|
|
10
|
-
mainStr += dayjs().format(`YYYY${divider}MM${divider}DD`);
|
|
11
|
-
if (useTime)
|
|
12
|
-
mainStr += (mainStr == "" ? "" : divider) + dayjs().format(`HH${divider}mm${divider}ss`);
|
|
13
|
-
return prefix + (prefix ? divider : "") + mainStr + (surfix ? divider : "") + surfix;
|
|
14
|
-
}
|
|
15
|
-
export default { makeDaySlug };
|
|
16
|
-
//# sourceMappingURL=makeDaySlug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"makeDaySlug.js","sourceRoot":"","sources":["../../src/string/makeDaySlug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,UAA0B,EAAE;IACvD,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE5F,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,OAAO;QAAE,OAAO,IAAI,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC;IACvE,IAAI,OAAO;QAAE,OAAO,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC;IAEtG,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;AACtF,CAAC;AAED,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
package/esm/string/random.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
/**
|
|
6
|
-
* allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
7
|
-
*/
|
|
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
|
-
export declare const uniqueSortByTime: (length?: number, str?: string) => string;
|
|
12
|
-
declare const random: {
|
|
13
|
-
randAllCharacterByLength: (length?: number) => string;
|
|
14
|
-
randomStringByLength: (length: number, str?: string) => string;
|
|
15
|
-
randomStringAndNumberByLength: (length: number, str?: string) => string;
|
|
16
|
-
uniqueSortByTime: (length?: number, str?: string) => string;
|
|
17
|
-
};
|
|
18
|
-
export default random;
|
package/esm/string/random.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const textLowCase = "abcdefghijklmnopqrstuvwxyz";
|
|
2
|
-
export const numeric = "0123456789";
|
|
3
|
-
export const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
|
|
4
|
-
export const allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
5
|
-
/**
|
|
6
|
-
* allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
7
|
-
*/
|
|
8
|
-
export const randAllCharacterByLength = (length = 0) => {
|
|
9
|
-
return randomStringByLength(length, allCharacter);
|
|
10
|
-
};
|
|
11
|
-
export const randomStringByLength = (length, str = textLowCase) => {
|
|
12
|
-
let result = "";
|
|
13
|
-
for (let i = 0; i < length; i++) {
|
|
14
|
-
result += str.charAt(Math.floor(Math.random() * str.length));
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
|
-
export const randomStringAndNumberByLength = (length, str = `${textLowCase}${numeric}`) => {
|
|
19
|
-
let result = "";
|
|
20
|
-
for (let i = 0; i < length; i++) {
|
|
21
|
-
result += str.charAt(Math.floor(Math.random() * str.length));
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
export const uniqueSortByTime = (length = 6, str = `${textLowCase}${numeric}`) => {
|
|
26
|
-
let result = `${+new Date()}-`;
|
|
27
|
-
for (let i = 0; i < length; i++) {
|
|
28
|
-
result += str.charAt(Math.floor(Math.random() * str.length));
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
const random = { randAllCharacterByLength, randomStringByLength, randomStringAndNumberByLength, uniqueSortByTime };
|
|
33
|
-
export default random;
|
|
34
|
-
//# sourceMappingURL=random.js.map
|
package/esm/string/random.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/string/random.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,4BAA4B,CAAC;AACxD,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,6BAA6B,CAAC;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,gPAAgP,CAAC;AAE7Q;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE;IACtD,OAAO,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAc,EAAE,GAAG,GAAG,WAAW,EAAE,EAAE;IACzE,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC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!str)
|
|
4
|
-
return "";
|
|
5
|
-
str = str.toString();
|
|
6
|
-
str = str.replace(/\0/g, "");
|
|
7
|
-
while (str.indexOf(" ") >= 0) {
|
|
8
|
-
str = str.replaceAll(" ", " ");
|
|
9
|
-
}
|
|
10
|
-
str = trim(str);
|
|
11
|
-
return str;
|
|
12
|
-
}
|
|
13
|
-
export default trimNull;
|
|
14
|
-
//# sourceMappingURL=trimNull.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trimNull.js","sourceRoot":"","sources":["../../src/string/trimNull.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,MAAM,UAAU,QAAQ,CAAC,GAAW;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IACrB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE7B,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC9B,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KAChC;IACD,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
package/esm/string/url.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
export declare const getFileExtension: (url: string) => string | null | undefined;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {string} url
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare const isImage: (url: string) => boolean;
|
|
13
|
-
declare const xurl: {
|
|
14
|
-
addQueryParam: (_url: string, key: string, value: any) => string;
|
|
15
|
-
getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
16
|
-
isLink: (str: string) => boolean;
|
|
17
|
-
getFileNameWithoutExtension: (url: string) => string;
|
|
18
|
-
getFileNameWithExtension: (url: string) => string;
|
|
19
|
-
getFileExtension: (url: string) => string | null | undefined;
|
|
20
|
-
isImage: (url: string) => boolean;
|
|
21
|
-
};
|
|
22
|
-
export default xurl;
|
package/esm/string/url.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
2
|
-
export const addQueryParam = (_url, key, value) => {
|
|
3
|
-
_url += (_url.split("?")[1] ? "&" : "?") + `${key}=${value}`;
|
|
4
|
-
return _url;
|
|
5
|
-
};
|
|
6
|
-
export const getUrlParams = (parameter, staticURL, decode = true) => {
|
|
7
|
-
if (typeof window == "undefined")
|
|
8
|
-
return "";
|
|
9
|
-
staticURL = staticURL == undefined ? window.location.host : staticURL;
|
|
10
|
-
var currLocation = staticURL.length > 0 ? staticURL : window.location.search;
|
|
11
|
-
if (currLocation.split("?").length < 2)
|
|
12
|
-
return "";
|
|
13
|
-
var parArr = currLocation.split("?")[1].split("&"), returnBool = true;
|
|
14
|
-
for (var i = 0; i < parArr.length; i++) {
|
|
15
|
-
var parr = parArr[i].split("=");
|
|
16
|
-
if (parr[0] == parameter) {
|
|
17
|
-
return decode ? decodeURIComponent(parr[1]) : parr[1];
|
|
18
|
-
returnBool = true;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
returnBool = false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (!returnBool)
|
|
25
|
-
return false;
|
|
26
|
-
};
|
|
27
|
-
export const isLink = (str) => {
|
|
28
|
-
return urlRegex.test(str);
|
|
29
|
-
};
|
|
30
|
-
export const getFileNameWithoutExtension = (url) => {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
return ((_b = (_a = getFileNameWithExtension(url)) === null || _a === void 0 ? void 0 : _a.split(".")) === null || _b === void 0 ? void 0 : _b[0]) || "";
|
|
33
|
-
};
|
|
34
|
-
export const getFileNameWithExtension = (url) => {
|
|
35
|
-
url = url.replaceAll("\\", "/");
|
|
36
|
-
const _url = decodeURIComponent(url);
|
|
37
|
-
const m = `${_url.toString().match(/(?:.*\/)?([^\/]+)/)}`;
|
|
38
|
-
if (m && m.split(",").length > 1) {
|
|
39
|
-
return m.split(",")[1].replace(/(\?.*)|(\&.*)/, "");
|
|
40
|
-
}
|
|
41
|
-
return "";
|
|
42
|
-
};
|
|
43
|
-
export const getFileExtension = (url) => {
|
|
44
|
-
const arr = getFileNameWithExtension(url).split(".");
|
|
45
|
-
if (arr.length > 1)
|
|
46
|
-
return getFileNameWithExtension(url).split(".").pop();
|
|
47
|
-
return null;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {string} url
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
export const isImage = (url) => {
|
|
55
|
-
if (!url)
|
|
56
|
-
return false;
|
|
57
|
-
const arr = [".png", ".jpg", ".jpeg", ".jpe", ".jif", ".jfif", ".gif", ".svg"];
|
|
58
|
-
const index = arr.findIndex((item) => {
|
|
59
|
-
return url.indexOf(item) >= 0;
|
|
60
|
-
});
|
|
61
|
-
return index >= 0;
|
|
62
|
-
};
|
|
63
|
-
const xurl = { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage };
|
|
64
|
-
export default xurl;
|
|
65
|
-
//# sourceMappingURL=url.js.map
|
package/esm/string/url.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/string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