@ztimson/utils 0.21.6 → 0.22.1
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/index.cjs +145 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +145 -16
- package/dist/index.mjs.map +1 -1
- package/dist/objects.d.ts +0 -1
- package/dist/string.d.ts +12 -0
- package/dist/time.d.ts +3 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/string.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare function formatPhoneNumber(number: string): string;
|
|
|
26
26
|
* @param {string} str - Value that will be injected to parent
|
|
27
27
|
* @param {number} index - Position to inject string at
|
|
28
28
|
* @returns {string} - New string
|
|
29
|
+
* @deprecated use `strSplice()`
|
|
29
30
|
*/
|
|
30
31
|
export declare function insertAt(target: string, str: string, index: number): String;
|
|
31
32
|
/**
|
|
@@ -83,6 +84,16 @@ export declare function randomString(length: number, pool?: string): string;
|
|
|
83
84
|
* @return {string} generated string
|
|
84
85
|
*/
|
|
85
86
|
export declare function randomStringBuilder(length: number, letters?: boolean, numbers?: boolean, symbols?: boolean): string;
|
|
87
|
+
/**
|
|
88
|
+
* Splice a string together (Similar to Array.splice)
|
|
89
|
+
*
|
|
90
|
+
* @param {string} str String that will be modified
|
|
91
|
+
* @param {number} start Start index of splice
|
|
92
|
+
* @param {number} deleteCount Number of characters to remove in splice
|
|
93
|
+
* @param {string} insert Insert new string into splice
|
|
94
|
+
* @return {string} Returned spliced string
|
|
95
|
+
*/
|
|
96
|
+
export declare function strSplice(str: string, start: number, deleteCount: number, insert?: string): string;
|
|
86
97
|
/**
|
|
87
98
|
* Find all substrings that match a given pattern.
|
|
88
99
|
*
|
|
@@ -111,6 +122,7 @@ export type ParsedUrl = {
|
|
|
111
122
|
*
|
|
112
123
|
* @param {string} url URL string that will be parsed
|
|
113
124
|
* @returns {RegExpExecArray} Parts of URL
|
|
125
|
+
* @deprecated Use built-in URL object: `new URL('...')`;
|
|
114
126
|
*/
|
|
115
127
|
export declare function parseUrl(url: string): ParsedUrl;
|
|
116
128
|
/**
|
package/dist/time.d.ts
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function adjustedInterval(cb: Function, ms: number): () => void;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Format date
|
|
10
10
|
*
|
|
11
11
|
* @param {Date | number | string} date Date or timestamp to convert to string
|
|
12
|
+
* @param {string} format How date string will be formatted, default: `YYYY-MM-DD H:mm A`
|
|
12
13
|
* @return {string} Formated date
|
|
13
14
|
*/
|
|
14
|
-
export declare function formatDate(date: Date | number | string): string;
|
|
15
|
+
export declare function formatDate(date: Date | number | string, format?: string): string;
|
|
15
16
|
/**
|
|
16
17
|
* Use in conjunction with `await` to pause an async script
|
|
17
18
|
*
|
package/dist/types.d.ts
CHANGED