@ztimson/utils 0.22.7 → 0.22.8

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/time.d.ts CHANGED
@@ -5,14 +5,24 @@
5
5
  * @return {() => void}
6
6
  */
7
7
  export declare function adjustedInterval(cb: Function, ms: number): () => void;
8
+ export declare function adjustTz(date: Date, offset: number): Date;
8
9
  /**
9
10
  * Format date
10
11
  *
11
12
  * @param {Date | number | string} date Date or timestamp to convert to string
12
13
  * @param {string} format How date string will be formatted, default: `YYYY-MM-DD H:mm A`
14
+ * @param tz Override timezone, can be either string or number
13
15
  * @return {string} Formated date
14
16
  */
15
- export declare function formatDate(date: Date | number | string, format?: string): string;
17
+ export declare function formatDate(date: Date | number | string, format?: string, tz?: any): string;
18
+ /**
19
+ * Run a function immediately & repeat every x ms
20
+ *
21
+ * @param {() => any} fn Callback function
22
+ * @param {number} interval Repeat in ms
23
+ * @return {number} Clear Interval ID
24
+ */
25
+ export declare function instantInterval(fn: () => any, interval: number): NodeJS.Timeout;
16
26
  /**
17
27
  * Use in conjunction with `await` to pause an async script
18
28
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/utils",
3
- "version": "0.22.7",
3
+ "version": "0.22.8",
4
4
  "description": "Utility library",
5
5
  "author": "Zak Timson",
6
6
  "license": "MIT",