minutool 1.0.14 → 1.0.15
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.d.ts +18 -0
- package/dist/minutool.js +593 -562
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +5 -5
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -203,6 +203,8 @@ export declare function capitalize(str: string): string;
|
|
|
203
203
|
*/
|
|
204
204
|
export declare const cleanNull: (obj: any, recursive?: boolean) => any;
|
|
205
205
|
|
|
206
|
+
export declare const convertMinutesToTimezoneOffsetStr: (offsetMinutes: number) => string;
|
|
207
|
+
|
|
206
208
|
/**
|
|
207
209
|
* 倒计时函数(该方法采用 setTimeout 方式,不够精准)
|
|
208
210
|
* @param {number} timeout - 倒计时总秒数
|
|
@@ -537,6 +539,22 @@ export declare const getJson: (url: string, data?: any, option?: RequestOption)
|
|
|
537
539
|
*/
|
|
538
540
|
export declare const getNodeXPath: (el: HTMLElement | null) => string | null;
|
|
539
541
|
|
|
542
|
+
/**
|
|
543
|
+
* 根据时区名称获取该时区相对于 UTC 的分钟偏移量(分钟)
|
|
544
|
+
* @param timeZone - 时区名称(如 "America/New_York")
|
|
545
|
+
* @param date - 可选的日期对象,默认为当前时间
|
|
546
|
+
*/
|
|
547
|
+
export declare const getTimezoneOffsetMinutes: (timeZone: string) => number;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* 根据时区名称获取该时区相对于 UTC 的偏移字符串(格式为 "+HH:MM" 或 "-HH:MM")
|
|
551
|
+
* @param timeZone - 时区名称(如 "America/New_York")
|
|
552
|
+
* @returns 偏移字符串(如 "-05:00")
|
|
553
|
+
* @example
|
|
554
|
+
* getTimezoneOffsetStr("America/New_York") // "-05:00"
|
|
555
|
+
*/
|
|
556
|
+
export declare const getTimezoneOffsetStr: (timeZone: string) => string;
|
|
557
|
+
|
|
540
558
|
/**
|
|
541
559
|
* 获取 UTF-8 字符串长度(一个中文字按照 3 个字数计算)
|
|
542
560
|
* @param {string} str - 要计算的字符串
|