diginext-utils 2.1.20 → 2.1.21
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/dist/Checker.d.ts +8 -8
- package/dist/Checker.js +31 -31
- package/dist/EventDispatcher.d.ts +13 -13
- package/dist/EventDispatcher.js +51 -51
- package/dist/FileUpload.d.ts +12 -12
- package/dist/FileUpload.js +64 -64
- package/dist/Slug.d.ts +9 -9
- package/dist/Slug.js +333 -333
- package/dist/Timer.d.ts +4 -4
- package/dist/Timer.js +8 -8
- package/dist/Validation.d.ts +5 -5
- package/dist/Validation.js +38 -38
- package/dist/array.d.ts +113 -113
- package/dist/array.js +297 -297
- package/dist/color.d.ts +25 -25
- package/dist/color.js +95 -95
- package/dist/console/enableConsole.d.ts +2 -2
- package/dist/console/enableConsole.js +13 -13
- package/dist/console/index.d.ts +11 -11
- package/dist/console/index.js +17 -17
- package/dist/console/log.d.ts +15 -15
- package/dist/console/log.js +44 -44
- package/dist/device/browser.d.ts +5 -5
- package/dist/device/browser.js +37 -37
- package/dist/device/camera.d.ts +7 -7
- package/dist/device/camera.js +171 -171
- package/dist/device/index.d.ts +5 -5
- package/dist/device/index.js +224 -224
- package/dist/device/os.d.ts +11 -11
- package/dist/device/os.js +37 -37
- package/dist/file/createDir.d.ts +5 -5
- package/dist/file/createDir.js +15 -15
- package/dist/file/fileMove.d.ts +4 -4
- package/dist/file/fileMove.js +32 -32
- package/dist/file/findFilesByExt.d.ts +13 -13
- package/dist/file/findFilesByExt.js +49 -49
- package/dist/file/getAllFiles.d.ts +1 -0
- package/dist/file/getAllFiles.js +27 -0
- package/dist/file/getAllFiles.js.map +1 -0
- package/dist/file/index.d.ts +9 -9
- package/dist/file/index.js +10 -10
- package/dist/gameboi/index.d.ts +10 -10
- package/dist/gameboi/index.js +67 -64
- package/dist/gameboi/index.js.map +1 -1
- package/dist/images/downloadByUrl.d.ts +1 -1
- package/dist/images/downloadByUrl.js +55 -55
- package/dist/images/index.d.ts +2 -2
- package/dist/images/index.js +8 -8
- package/dist/images/loadImage.d.ts +1 -1
- package/dist/images/loadImage.js +17 -17
- package/dist/images/resize.d.ts +2 -2
- package/dist/images/resize.js +37 -37
- package/dist/images/upload.d.ts +10 -10
- package/dist/images/upload.js +26 -26
- package/dist/index.d.ts +37 -37
- package/dist/index.js +62 -62
- package/dist/json.d.ts +8 -8
- package/dist/json.js +31 -31
- package/dist/math/diffDate.d.ts +5 -5
- package/dist/math/diffDate.js +13 -13
- package/dist/math/index.d.ts +30 -30
- package/dist/math/index.js +92 -92
- package/dist/math/positiveNumber.d.ts +2 -2
- package/dist/math/positiveNumber.js +16 -16
- package/dist/name/en.d.ts +5 -5
- package/dist/name/en.js +25 -25
- package/dist/name/index.d.ts +12 -12
- package/dist/name/index.js +12 -12
- package/dist/name/vi.d.ts +5 -5
- package/dist/name/vi.js +27 -27
- package/dist/object.d.ts +59 -59
- package/dist/object.js +79 -79
- package/dist/permission/index.d.ts +8 -8
- package/dist/permission/index.js +6 -6
- package/dist/permission/requestCamera.d.ts +5 -5
- package/dist/permission/requestCamera.js +42 -42
- package/dist/permission/requestDeviceOrientationControl.d.ts +2 -2
- package/dist/permission/requestDeviceOrientationControl.js +38 -38
- package/dist/response/index.d.ts +49 -49
- package/dist/response/index.js +51 -51
- package/dist/string/convertPathnameAndQuery.d.ts +4 -4
- package/dist/string/convertPathnameAndQuery.js +24 -24
- package/dist/string/formatNumber.d.ts +6 -6
- package/dist/string/formatNumber.js +14 -14
- package/dist/string/generatePassword.d.ts +9 -9
- package/dist/string/generatePassword.js +23 -23
- package/dist/string/generateUUID.d.ts +2 -2
- package/dist/string/generateUUID.js +36 -36
- package/dist/string/getTextBetweenCharByIndex.d.ts +1 -1
- package/dist/string/getTextBetweenCharByIndex.js +20 -20
- package/dist/string/index.d.ts +65 -65
- package/dist/string/index.js +161 -161
- package/dist/string/indexesOf.d.ts +1 -1
- package/dist/string/indexesOf.js +14 -14
- package/dist/string/makeDaySlug.d.ts +31 -31
- package/dist/string/makeDaySlug.js +22 -22
- package/dist/string/random.d.ts +18 -18
- package/dist/string/random.js +40 -40
- package/dist/string/trimNull.d.ts +2 -2
- package/dist/string/trimNull.js +20 -20
- package/dist/string/url.d.ts +22 -22
- package/dist/string/url.js +74 -74
- package/esm/Checker.d.ts +8 -8
- package/esm/Checker.js +27 -27
- package/esm/EventDispatcher.d.ts +13 -13
- package/esm/EventDispatcher.js +48 -48
- package/esm/FileUpload.d.ts +12 -12
- package/esm/FileUpload.js +61 -61
- package/esm/Slug.d.ts +9 -9
- package/esm/Slug.js +329 -329
- package/esm/Timer.d.ts +4 -4
- package/esm/Timer.js +6 -6
- package/esm/Validation.d.ts +5 -5
- package/esm/Validation.js +36 -36
- package/esm/array.d.ts +113 -113
- package/esm/array.js +275 -275
- package/esm/color.d.ts +25 -25
- package/esm/color.js +85 -85
- package/esm/console/enableConsole.d.ts +2 -2
- package/esm/console/enableConsole.js +6 -6
- package/esm/console/index.d.ts +11 -11
- package/esm/console/index.js +12 -12
- package/esm/console/log.d.ts +15 -15
- package/esm/console/log.js +32 -32
- package/esm/device/browser.d.ts +5 -5
- package/esm/device/browser.js +29 -29
- package/esm/device/camera.d.ts +7 -7
- package/esm/device/camera.js +167 -167
- package/esm/device/index.d.ts +5 -5
- package/esm/device/index.js +216 -216
- package/esm/device/os.d.ts +11 -11
- package/esm/device/os.js +27 -27
- package/esm/file/createDir.d.ts +5 -5
- package/esm/file/createDir.js +12 -12
- package/esm/file/fileMove.d.ts +4 -4
- package/esm/file/fileMove.js +28 -28
- package/esm/file/findFilesByExt.d.ts +13 -13
- package/esm/file/findFilesByExt.js +45 -45
- package/esm/file/getAllFiles.d.ts +1 -0
- package/esm/file/getAllFiles.js +21 -0
- package/esm/file/getAllFiles.js.map +1 -0
- package/esm/file/index.d.ts +9 -9
- package/esm/file/index.js +5 -5
- package/esm/gameboi/index.d.ts +10 -10
- package/esm/gameboi/index.js +61 -61
- package/esm/gameboi/index.js.map +1 -1
- package/esm/images/downloadByUrl.d.ts +1 -1
- package/esm/images/downloadByUrl.js +52 -52
- package/esm/images/index.d.ts +2 -2
- package/esm/images/index.js +3 -3
- package/esm/images/loadImage.d.ts +1 -1
- package/esm/images/loadImage.js +14 -14
- package/esm/images/resize.d.ts +2 -2
- package/esm/images/resize.js +30 -30
- package/esm/images/upload.d.ts +10 -10
- package/esm/images/upload.js +19 -19
- package/esm/index.d.ts +37 -37
- package/esm/index.js +37 -37
- package/esm/json.d.ts +8 -8
- package/esm/json.js +27 -27
- package/esm/math/diffDate.d.ts +5 -5
- package/esm/math/diffDate.js +9 -9
- package/esm/math/index.d.ts +30 -30
- package/esm/math/index.js +77 -77
- package/esm/math/positiveNumber.d.ts +2 -2
- package/esm/math/positiveNumber.js +12 -12
- package/esm/name/en.d.ts +5 -5
- package/esm/name/en.js +21 -21
- package/esm/name/index.d.ts +12 -12
- package/esm/name/index.js +5 -5
- package/esm/name/vi.d.ts +5 -5
- package/esm/name/vi.js +23 -23
- package/esm/object.d.ts +59 -59
- package/esm/object.js +69 -69
- package/esm/permission/index.d.ts +8 -8
- package/esm/permission/index.js +4 -4
- package/esm/permission/requestCamera.d.ts +5 -5
- package/esm/permission/requestCamera.js +38 -38
- package/esm/permission/requestDeviceOrientationControl.d.ts +2 -2
- package/esm/permission/requestDeviceOrientationControl.js +34 -34
- package/esm/response/index.d.ts +49 -49
- package/esm/response/index.js +45 -45
- package/esm/string/convertPathnameAndQuery.d.ts +4 -4
- package/esm/string/convertPathnameAndQuery.js +21 -21
- package/esm/string/formatNumber.d.ts +6 -6
- package/esm/string/formatNumber.js +10 -10
- package/esm/string/generatePassword.d.ts +9 -9
- package/esm/string/generatePassword.js +19 -19
- package/esm/string/generateUUID.d.ts +2 -2
- package/esm/string/generateUUID.js +32 -32
- package/esm/string/getTextBetweenCharByIndex.d.ts +1 -1
- package/esm/string/getTextBetweenCharByIndex.js +14 -14
- package/esm/string/index.d.ts +65 -65
- package/esm/string/index.js +150 -150
- package/esm/string/indexesOf.d.ts +1 -1
- package/esm/string/indexesOf.js +11 -11
- package/esm/string/makeDaySlug.d.ts +31 -31
- package/esm/string/makeDaySlug.js +15 -15
- package/esm/string/random.d.ts +18 -18
- package/esm/string/random.js +33 -33
- package/esm/string/trimNull.d.ts +2 -2
- package/esm/string/trimNull.js +13 -13
- package/esm/string/url.d.ts +22 -22
- package/esm/string/url.js +64 -64
- package/package.json +4 -4
package/esm/string/index.d.ts
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
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 | null | undefined;
|
|
63
|
-
isImage: (url: string) => boolean;
|
|
64
|
-
};
|
|
65
|
-
export default xstring;
|
|
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 | null | undefined;
|
|
63
|
+
isImage: (url: string) => boolean;
|
|
64
|
+
};
|
|
65
|
+
export default xstring;
|
package/esm/string/index.js
CHANGED
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
import { isNull } from "../object";
|
|
2
|
-
//prettier-ignore
|
|
3
|
-
const char_map = { À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", Æ: "AE", Ç: "C", È: "E", É: "E", Ê: "E", Ë: "E", Ì: "I", Í: "I", Î: "I", Ï: "I", Ð: "D", Ñ: "N", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ő: "O", Ø: "O", Ù: "U", Ú: "U", Û: "U", Ű: "U", Ý: "Y", Þ: "TH", ß: "ss", à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", æ: "ae", è: "e", é: "e", ê: "e", ë: "e", ì: "i", í: "i", î: "i", ï: "i", ð: "d", ñ: "n", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ő: "o", ø: "o", ù: "u", ú: "u", û: "u", ű: "u", ý: "y", þ: "th", ÿ: "y", "©": "(c)", Γ: "G", Δ: "D", Θ: "8", Λ: "L", Ξ: "3", Π: "P", Σ: "S", Φ: "F", Ψ: "PS", Ω: "W", Ά: "A", Έ: "E", Ί: "I", Ό: "O", Ύ: "Y", Ή: "H", Ώ: "W", Ϊ: "I", Ϋ: "Y", β: "b", "γ": "y", δ: "d", ε: "e", ζ: "z", η: "h", θ: "8", ι: "i", κ: "k", λ: "l", μ: "m", ν: "n", ξ: "3", ο: "o", π: "p", ρ: "r", σ: "s", τ: "t", υ: "y", φ: "f", χ: "x", ψ: "ps", ω: "w", ά: "a", έ: "e", ί: "i", ό: "o", ύ: "y", ή: "h", ώ: "w", ς: "s", ϊ: "i", ΰ: "y", ϋ: "y", ΐ: "i", Ş: "S", İ: "I", Ü: "U", Ğ: "G", ş: "s", ı: "i", ç: "c", ü: "u", ğ: "g", А: "A", Б: "B", В: "V", Г: "G", Д: "D", Е: "E", Ё: "Yo", Ж: "Zh", З: "Z", И: "I", Й: "J", К: "K", Л: "L", М: "M", Н: "N", О: "O", П: "P", Р: "R", С: "S", Т: "T", У: "U", Ф: "F", Х: "H", Ц: "C", Ч: "Ch", Ш: "Sh", Щ: "Sh", Ъ: "", Ы: "Y", Ь: "", Э: "E", Ю: "Yu", Я: "Ya", а: "a", б: "b", в: "v", г: "g", д: "d", е: "e", ё: "yo", ж: "zh", з: "z", и: "i", й: "j", к: "k", л: "l", м: "m", н: "n", о: "o", п: "p", р: "r", с: "s", т: "t", у: "u", ф: "f", х: "h", ц: "c", ч: "ch", ш: "sh", щ: "sh", ъ: "", ы: "y", ь: "", э: "e", ю: "yu", я: "ya", Є: "Ye", І: "I", Ї: "Yi", Ґ: "G", є: "ye", і: "i", ї: "yi", ґ: "g", Č: "C", Ď: "D", Ě: "E", Ň: "N", Ř: "R", Š: "S", Ť: "T", Ů: "U", Ž: "Z", č: "c", ď: "d", ě: "e", ň: "n", ř: "r", š: "s", ť: "t", ů: "u", ž: "z", Ą: "A", Ć: "C", Ę: "e", Ł: "L", Ń: "N", Ś: "S", Ź: "Z", Ż: "Z", ą: "a", ć: "c", ę: "e", ł: "l", ń: "n", ś: "s", ź: "z", ż: "z", Ā: "A", Ē: "E", Ģ: "G", Ī: "i", Ķ: "k", Ļ: "L", Ņ: "N", Ū: "u", ā: "a", ē: "e", ģ: "g", ī: "i", ķ: "k", ļ: "l", ņ: "n", ū: "u" };
|
|
4
|
-
/**
|
|
5
|
-
* Get string between str1 and str2 from text
|
|
6
|
-
*/
|
|
7
|
-
export const getBetween = (text, str1, str2 = "") => {
|
|
8
|
-
if (!text)
|
|
9
|
-
return "";
|
|
10
|
-
if (text.indexOf(str1) <= -1)
|
|
11
|
-
return "";
|
|
12
|
-
const firstIndex = text.indexOf(str1) + str1.length;
|
|
13
|
-
const secondIndex = str2 ? text.indexOf(str2, firstIndex) : text.length;
|
|
14
|
-
return text.substring(firstIndex, secondIndex);
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Convert object to string
|
|
18
|
-
*/
|
|
19
|
-
export const makeString = (object = "") => {
|
|
20
|
-
/// Ensure some object is a coerced to a string
|
|
21
|
-
if (isNull(object))
|
|
22
|
-
return "";
|
|
23
|
-
return "" + object;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* toUpperCase
|
|
27
|
-
*/
|
|
28
|
-
export const toUpperCase = (str = "") => {
|
|
29
|
-
return makeString(str).toUpperCase();
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* toLowerCase
|
|
33
|
-
*/
|
|
34
|
-
export const toLowerCase = (str = "") => {
|
|
35
|
-
return makeString(str).toLowerCase();
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* toLowerCase
|
|
39
|
-
* @param {*} str
|
|
40
|
-
* @return {string}
|
|
41
|
-
*/
|
|
42
|
-
export const titleize = (str = "") => {
|
|
43
|
-
const regString = new RegExp(/(?:^|\s|-)\S/g);
|
|
44
|
-
return toLowerCase(str).replace(regString, function (c) {
|
|
45
|
-
return c.toUpperCase();
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Convert only first charater to UpperCase
|
|
50
|
-
*/
|
|
51
|
-
export const capitalize = (str, lowercaseRest = 1) => {
|
|
52
|
-
str = makeString(str);
|
|
53
|
-
const remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase();
|
|
54
|
-
return str.charAt(0).toUpperCase() + remainingChars;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Convert first character from every single words to UpperCase
|
|
58
|
-
*/
|
|
59
|
-
export const capitalizeName = (str) => {
|
|
60
|
-
str = makeString(str);
|
|
61
|
-
str = str.replace(/-/g, " ");
|
|
62
|
-
str = str.trim();
|
|
63
|
-
str = str.replace(/^\s+|\s+$/gm, "");
|
|
64
|
-
str = str.toLowerCase();
|
|
65
|
-
const arr = str.split(" ");
|
|
66
|
-
str = arr
|
|
67
|
-
.map((item) => {
|
|
68
|
-
return capitalize(item);
|
|
69
|
-
})
|
|
70
|
-
.filter((x) => x)
|
|
71
|
-
.join(" ");
|
|
72
|
-
return str;
|
|
73
|
-
};
|
|
74
|
-
export const clearUnicodeCharacters = (s, opt = {}) => {
|
|
75
|
-
s = makeString(s);
|
|
76
|
-
var defaults = {
|
|
77
|
-
delimiter: " ",
|
|
78
|
-
lowercase: true,
|
|
79
|
-
replacements: {},
|
|
80
|
-
transliterate: typeof XRegExp === "undefined" ? true : false,
|
|
81
|
-
};
|
|
82
|
-
// Merge options
|
|
83
|
-
for (var k in defaults) {
|
|
84
|
-
if (!opt.hasOwnProperty(k)) {
|
|
85
|
-
opt[k] = defaults[k];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Vietnamese
|
|
89
|
-
s = s.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, "a");
|
|
90
|
-
s = s.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, "e");
|
|
91
|
-
s = s.replace(/i|í|ì|ỉ|ĩ|ị/gi, "i");
|
|
92
|
-
s = s.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, "o");
|
|
93
|
-
s = s.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, "u");
|
|
94
|
-
s = s.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, "y");
|
|
95
|
-
s = s.replace(/đ/gi, "d");
|
|
96
|
-
s = "@" + s + "@";
|
|
97
|
-
s = s.replace(/\@\-|\-\@|\@/gi, "");
|
|
98
|
-
// Make custom replacements
|
|
99
|
-
for (var k in opt.replacements) {
|
|
100
|
-
s = s.replace(RegExp(k, "g"), opt.replacements[k]);
|
|
101
|
-
}
|
|
102
|
-
// Transliterate characters to ASCII
|
|
103
|
-
if (opt.transliterate) {
|
|
104
|
-
for (var k in char_map) {
|
|
105
|
-
s = s.replace(RegExp(k, "g"), char_map[k]);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// Replace non-alphanumeric characters with our delimiter
|
|
109
|
-
var alnum = typeof XRegExp === "undefined" ? RegExp("[^a-z0-9]+", "ig") : XRegExp("[^\\p{L}\\p{N}]+", "ig");
|
|
110
|
-
s = s.replace(alnum, opt.delimiter);
|
|
111
|
-
// Remove duplicate delimiters
|
|
112
|
-
s = s.replace(RegExp("[" + opt.delimiter + "]{2,}", "g"), opt.delimiter);
|
|
113
|
-
// Truncate slug to max. characters
|
|
114
|
-
s = s.substring(0, opt.limit);
|
|
115
|
-
// Remove delimiter from ends
|
|
116
|
-
s = s.replace(RegExp("(^" + opt.delimiter + "|" + opt.delimiter + "$)", "g"), "");
|
|
117
|
-
return opt.lowercase ? s.toLowerCase() : s;
|
|
118
|
-
};
|
|
119
|
-
import { makeDaySlug } from "./makeDaySlug";
|
|
120
|
-
import { generateUUID } from "./generateUUID";
|
|
121
|
-
import { randAllCharacterByLength, randomStringByLength } from "./random";
|
|
122
|
-
import { formatNumber } from "./formatNumber";
|
|
123
|
-
import { generatePassword } from "./generatePassword";
|
|
124
|
-
import { trimNull } from "./trimNull";
|
|
125
|
-
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage } from "./url";
|
|
126
|
-
const xstring = {
|
|
127
|
-
getBetween,
|
|
128
|
-
makeString,
|
|
129
|
-
makeDaySlug,
|
|
130
|
-
toUpperCase,
|
|
131
|
-
toLowerCase,
|
|
132
|
-
titleize,
|
|
133
|
-
capitalize,
|
|
134
|
-
capitalizeName,
|
|
135
|
-
clearUnicodeCharacters,
|
|
136
|
-
generateUUID,
|
|
137
|
-
randAllCharacterByLength,
|
|
138
|
-
randomStringByLength,
|
|
139
|
-
formatNumber,
|
|
140
|
-
generatePassword,
|
|
141
|
-
trimNull,
|
|
142
|
-
addQueryParam,
|
|
143
|
-
getUrlParams,
|
|
144
|
-
isLink,
|
|
145
|
-
getFileNameWithoutExtension,
|
|
146
|
-
getFileNameWithExtension,
|
|
147
|
-
getFileExtension,
|
|
148
|
-
isImage,
|
|
149
|
-
};
|
|
150
|
-
export default xstring;
|
|
1
|
+
import { isNull } from "../object";
|
|
2
|
+
//prettier-ignore
|
|
3
|
+
const char_map = { À: "A", Á: "A", Â: "A", Ã: "A", Ä: "A", Å: "A", Æ: "AE", Ç: "C", È: "E", É: "E", Ê: "E", Ë: "E", Ì: "I", Í: "I", Î: "I", Ï: "I", Ð: "D", Ñ: "N", Ò: "O", Ó: "O", Ô: "O", Õ: "O", Ö: "O", Ő: "O", Ø: "O", Ù: "U", Ú: "U", Û: "U", Ű: "U", Ý: "Y", Þ: "TH", ß: "ss", à: "a", á: "a", â: "a", ã: "a", ä: "a", å: "a", æ: "ae", è: "e", é: "e", ê: "e", ë: "e", ì: "i", í: "i", î: "i", ï: "i", ð: "d", ñ: "n", ò: "o", ó: "o", ô: "o", õ: "o", ö: "o", ő: "o", ø: "o", ù: "u", ú: "u", û: "u", ű: "u", ý: "y", þ: "th", ÿ: "y", "©": "(c)", Γ: "G", Δ: "D", Θ: "8", Λ: "L", Ξ: "3", Π: "P", Σ: "S", Φ: "F", Ψ: "PS", Ω: "W", Ά: "A", Έ: "E", Ί: "I", Ό: "O", Ύ: "Y", Ή: "H", Ώ: "W", Ϊ: "I", Ϋ: "Y", β: "b", "γ": "y", δ: "d", ε: "e", ζ: "z", η: "h", θ: "8", ι: "i", κ: "k", λ: "l", μ: "m", ν: "n", ξ: "3", ο: "o", π: "p", ρ: "r", σ: "s", τ: "t", υ: "y", φ: "f", χ: "x", ψ: "ps", ω: "w", ά: "a", έ: "e", ί: "i", ό: "o", ύ: "y", ή: "h", ώ: "w", ς: "s", ϊ: "i", ΰ: "y", ϋ: "y", ΐ: "i", Ş: "S", İ: "I", Ü: "U", Ğ: "G", ş: "s", ı: "i", ç: "c", ü: "u", ğ: "g", А: "A", Б: "B", В: "V", Г: "G", Д: "D", Е: "E", Ё: "Yo", Ж: "Zh", З: "Z", И: "I", Й: "J", К: "K", Л: "L", М: "M", Н: "N", О: "O", П: "P", Р: "R", С: "S", Т: "T", У: "U", Ф: "F", Х: "H", Ц: "C", Ч: "Ch", Ш: "Sh", Щ: "Sh", Ъ: "", Ы: "Y", Ь: "", Э: "E", Ю: "Yu", Я: "Ya", а: "a", б: "b", в: "v", г: "g", д: "d", е: "e", ё: "yo", ж: "zh", з: "z", и: "i", й: "j", к: "k", л: "l", м: "m", н: "n", о: "o", п: "p", р: "r", с: "s", т: "t", у: "u", ф: "f", х: "h", ц: "c", ч: "ch", ш: "sh", щ: "sh", ъ: "", ы: "y", ь: "", э: "e", ю: "yu", я: "ya", Є: "Ye", І: "I", Ї: "Yi", Ґ: "G", є: "ye", і: "i", ї: "yi", ґ: "g", Č: "C", Ď: "D", Ě: "E", Ň: "N", Ř: "R", Š: "S", Ť: "T", Ů: "U", Ž: "Z", č: "c", ď: "d", ě: "e", ň: "n", ř: "r", š: "s", ť: "t", ů: "u", ž: "z", Ą: "A", Ć: "C", Ę: "e", Ł: "L", Ń: "N", Ś: "S", Ź: "Z", Ż: "Z", ą: "a", ć: "c", ę: "e", ł: "l", ń: "n", ś: "s", ź: "z", ż: "z", Ā: "A", Ē: "E", Ģ: "G", Ī: "i", Ķ: "k", Ļ: "L", Ņ: "N", Ū: "u", ā: "a", ē: "e", ģ: "g", ī: "i", ķ: "k", ļ: "l", ņ: "n", ū: "u" };
|
|
4
|
+
/**
|
|
5
|
+
* Get string between str1 and str2 from text
|
|
6
|
+
*/
|
|
7
|
+
export const getBetween = (text, str1, str2 = "") => {
|
|
8
|
+
if (!text)
|
|
9
|
+
return "";
|
|
10
|
+
if (text.indexOf(str1) <= -1)
|
|
11
|
+
return "";
|
|
12
|
+
const firstIndex = text.indexOf(str1) + str1.length;
|
|
13
|
+
const secondIndex = str2 ? text.indexOf(str2, firstIndex) : text.length;
|
|
14
|
+
return text.substring(firstIndex, secondIndex);
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Convert object to string
|
|
18
|
+
*/
|
|
19
|
+
export const makeString = (object = "") => {
|
|
20
|
+
/// Ensure some object is a coerced to a string
|
|
21
|
+
if (isNull(object))
|
|
22
|
+
return "";
|
|
23
|
+
return "" + object;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* toUpperCase
|
|
27
|
+
*/
|
|
28
|
+
export const toUpperCase = (str = "") => {
|
|
29
|
+
return makeString(str).toUpperCase();
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* toLowerCase
|
|
33
|
+
*/
|
|
34
|
+
export const toLowerCase = (str = "") => {
|
|
35
|
+
return makeString(str).toLowerCase();
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* toLowerCase
|
|
39
|
+
* @param {*} str
|
|
40
|
+
* @return {string}
|
|
41
|
+
*/
|
|
42
|
+
export const titleize = (str = "") => {
|
|
43
|
+
const regString = new RegExp(/(?:^|\s|-)\S/g);
|
|
44
|
+
return toLowerCase(str).replace(regString, function (c) {
|
|
45
|
+
return c.toUpperCase();
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Convert only first charater to UpperCase
|
|
50
|
+
*/
|
|
51
|
+
export const capitalize = (str, lowercaseRest = 1) => {
|
|
52
|
+
str = makeString(str);
|
|
53
|
+
const remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase();
|
|
54
|
+
return str.charAt(0).toUpperCase() + remainingChars;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Convert first character from every single words to UpperCase
|
|
58
|
+
*/
|
|
59
|
+
export const capitalizeName = (str) => {
|
|
60
|
+
str = makeString(str);
|
|
61
|
+
str = str.replace(/-/g, " ");
|
|
62
|
+
str = str.trim();
|
|
63
|
+
str = str.replace(/^\s+|\s+$/gm, "");
|
|
64
|
+
str = str.toLowerCase();
|
|
65
|
+
const arr = str.split(" ");
|
|
66
|
+
str = arr
|
|
67
|
+
.map((item) => {
|
|
68
|
+
return capitalize(item);
|
|
69
|
+
})
|
|
70
|
+
.filter((x) => x)
|
|
71
|
+
.join(" ");
|
|
72
|
+
return str;
|
|
73
|
+
};
|
|
74
|
+
export const clearUnicodeCharacters = (s, opt = {}) => {
|
|
75
|
+
s = makeString(s);
|
|
76
|
+
var defaults = {
|
|
77
|
+
delimiter: " ",
|
|
78
|
+
lowercase: true,
|
|
79
|
+
replacements: {},
|
|
80
|
+
transliterate: typeof XRegExp === "undefined" ? true : false,
|
|
81
|
+
};
|
|
82
|
+
// Merge options
|
|
83
|
+
for (var k in defaults) {
|
|
84
|
+
if (!opt.hasOwnProperty(k)) {
|
|
85
|
+
opt[k] = defaults[k];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Vietnamese
|
|
89
|
+
s = s.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, "a");
|
|
90
|
+
s = s.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, "e");
|
|
91
|
+
s = s.replace(/i|í|ì|ỉ|ĩ|ị/gi, "i");
|
|
92
|
+
s = s.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, "o");
|
|
93
|
+
s = s.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, "u");
|
|
94
|
+
s = s.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, "y");
|
|
95
|
+
s = s.replace(/đ/gi, "d");
|
|
96
|
+
s = "@" + s + "@";
|
|
97
|
+
s = s.replace(/\@\-|\-\@|\@/gi, "");
|
|
98
|
+
// Make custom replacements
|
|
99
|
+
for (var k in opt.replacements) {
|
|
100
|
+
s = s.replace(RegExp(k, "g"), opt.replacements[k]);
|
|
101
|
+
}
|
|
102
|
+
// Transliterate characters to ASCII
|
|
103
|
+
if (opt.transliterate) {
|
|
104
|
+
for (var k in char_map) {
|
|
105
|
+
s = s.replace(RegExp(k, "g"), char_map[k]);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Replace non-alphanumeric characters with our delimiter
|
|
109
|
+
var alnum = typeof XRegExp === "undefined" ? RegExp("[^a-z0-9]+", "ig") : XRegExp("[^\\p{L}\\p{N}]+", "ig");
|
|
110
|
+
s = s.replace(alnum, opt.delimiter);
|
|
111
|
+
// Remove duplicate delimiters
|
|
112
|
+
s = s.replace(RegExp("[" + opt.delimiter + "]{2,}", "g"), opt.delimiter);
|
|
113
|
+
// Truncate slug to max. characters
|
|
114
|
+
s = s.substring(0, opt.limit);
|
|
115
|
+
// Remove delimiter from ends
|
|
116
|
+
s = s.replace(RegExp("(^" + opt.delimiter + "|" + opt.delimiter + "$)", "g"), "");
|
|
117
|
+
return opt.lowercase ? s.toLowerCase() : s;
|
|
118
|
+
};
|
|
119
|
+
import { makeDaySlug } from "./makeDaySlug";
|
|
120
|
+
import { generateUUID } from "./generateUUID";
|
|
121
|
+
import { randAllCharacterByLength, randomStringByLength } from "./random";
|
|
122
|
+
import { formatNumber } from "./formatNumber";
|
|
123
|
+
import { generatePassword } from "./generatePassword";
|
|
124
|
+
import { trimNull } from "./trimNull";
|
|
125
|
+
import { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage } from "./url";
|
|
126
|
+
const xstring = {
|
|
127
|
+
getBetween,
|
|
128
|
+
makeString,
|
|
129
|
+
makeDaySlug,
|
|
130
|
+
toUpperCase,
|
|
131
|
+
toLowerCase,
|
|
132
|
+
titleize,
|
|
133
|
+
capitalize,
|
|
134
|
+
capitalizeName,
|
|
135
|
+
clearUnicodeCharacters,
|
|
136
|
+
generateUUID,
|
|
137
|
+
randAllCharacterByLength,
|
|
138
|
+
randomStringByLength,
|
|
139
|
+
formatNumber,
|
|
140
|
+
generatePassword,
|
|
141
|
+
trimNull,
|
|
142
|
+
addQueryParam,
|
|
143
|
+
getUrlParams,
|
|
144
|
+
isLink,
|
|
145
|
+
getFileNameWithoutExtension,
|
|
146
|
+
getFileNameWithExtension,
|
|
147
|
+
getFileExtension,
|
|
148
|
+
isImage,
|
|
149
|
+
};
|
|
150
|
+
export default xstring;
|
|
151
151
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function indexesOf(str: string, regex: any): any[];
|
|
1
|
+
export default function indexesOf(str: string, regex: any): any[];
|
package/esm/string/indexesOf.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default function indexesOf(str, regex) {
|
|
2
|
-
let match, indexes = {};
|
|
3
|
-
const list = [];
|
|
4
|
-
regex = new RegExp(regex);
|
|
5
|
-
while ((match = regex.exec(str))) {
|
|
6
|
-
if (!indexes[match[0]])
|
|
7
|
-
indexes[match[0]] = [];
|
|
8
|
-
list.push(match.index);
|
|
9
|
-
}
|
|
10
|
-
return list;
|
|
11
|
-
}
|
|
1
|
+
export default function indexesOf(str, regex) {
|
|
2
|
+
let match, indexes = {};
|
|
3
|
+
const list = [];
|
|
4
|
+
regex = new RegExp(regex);
|
|
5
|
+
while ((match = regex.exec(str))) {
|
|
6
|
+
if (!indexes[match[0]])
|
|
7
|
+
indexes[match[0]] = [];
|
|
8
|
+
list.push(match.index);
|
|
9
|
+
}
|
|
10
|
+
return list;
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=indexesOf.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
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
|
+
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 +1,16 @@
|
|
|
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 };
|
|
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
16
|
//# sourceMappingURL=makeDaySlug.js.map
|
package/esm/string/random.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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;
|
|
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;
|