@ztimson/utils 0.25.10 → 0.25.13
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/cache.d.ts +7 -0
- package/dist/index.cjs +39 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +39 -3
- package/dist/index.mjs.map +1 -1
- package/dist/time.d.ts +7 -0
- package/package.json +1 -1
package/dist/time.d.ts
CHANGED
|
@@ -56,3 +56,10 @@ export declare function sleepWhile(fn: () => boolean | Promise<boolean>, checkIn
|
|
|
56
56
|
* @returns {number} - Number of milliseconds until target
|
|
57
57
|
*/
|
|
58
58
|
export declare function timeUntil(date: Date | number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Convert a timezone string (e.g., "America/Toronto") to its current UTC offset in minutes.
|
|
61
|
+
* @param {string} tz - Timezone string, e.g. "America/Toronto"
|
|
62
|
+
* @param {Date} [date=new Date()] - The date for which you want the offset (default is now)
|
|
63
|
+
* @returns {number} - Offset in minutes (e.g., -240)
|
|
64
|
+
*/
|
|
65
|
+
export declare function timezoneOffset(tz: string, date?: Date): number;
|