@ztimson/utils 0.21.5 → 0.22.0

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/string.d.ts CHANGED
@@ -83,6 +83,16 @@ export declare function randomString(length: number, pool?: string): string;
83
83
  * @return {string} generated string
84
84
  */
85
85
  export declare function randomStringBuilder(length: number, letters?: boolean, numbers?: boolean, symbols?: boolean): string;
86
+ /**
87
+ * Splice a string together (Similar to Array.splice)
88
+ *
89
+ * @param {string} str String that will be modified
90
+ * @param {number} start Start index of splice
91
+ * @param {number} deleteCount Number of characters to remove in splice
92
+ * @param {string} insert Insert new string into splice
93
+ * @return {string} Returned spliced string
94
+ */
95
+ export declare function strSplice(str: string, start: number, deleteCount: number, insert?: string): string;
86
96
  /**
87
97
  * Find all substrings that match a given pattern.
88
98
  *
package/dist/time.d.ts CHANGED
@@ -1,10 +1,18 @@
1
1
  /**
2
- * Return date formated highest to lowest: YYYY-MM-DD H:mm AM
2
+ * Like setInterval but will adjust the timeout value to account for runtime
3
+ * @param {Function} cb Callback function that will be ran
4
+ * @param {number} ms Run function ever x seconds
5
+ * @return {() => void}
6
+ */
7
+ export declare function adjustedInterval(cb: Function, ms: number): () => void;
8
+ /**
9
+ * Format date
3
10
  *
4
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`
5
13
  * @return {string} Formated date
6
14
  */
7
- export declare function formatDate(date: Date | number | string): string;
15
+ export declare function formatDate(date: Date | number | string, format?: string): string;
8
16
  /**
9
17
  * Use in conjunction with `await` to pause an async script
10
18
  *
package/dist/types.d.ts CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/utils",
3
- "version": "0.21.5",
3
+ "version": "0.22.0",
4
4
  "description": "Utility library",
5
5
  "author": "Zak Timson",
6
6
  "license": "MIT",