minutool 1.0.5 → 1.0.7
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 +21 -2
- package/dist/minutool.js +196 -187
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +3 -3
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -286,11 +286,14 @@ export declare function deepClone<T>(obj: T): T;
|
|
|
286
286
|
/**
|
|
287
287
|
* 删除 Cookie
|
|
288
288
|
* @param {string} name - Cookie 名称
|
|
289
|
+
* @param {string} [path='/'] - Cookie 路径,必须与设置时的路径一致
|
|
290
|
+
* @param {string} [domain] - Cookie 域名,必须与设置时的域名一致
|
|
289
291
|
* @returns {void}
|
|
290
292
|
* @example
|
|
291
293
|
* deleteCookie('username')
|
|
294
|
+
* deleteCookie('username', '/', '.example.com')
|
|
292
295
|
*/
|
|
293
|
-
export declare const deleteCookie: (name: string) => void;
|
|
296
|
+
export declare const deleteCookie: (name: string, path?: string, domain?: string) => void;
|
|
294
297
|
|
|
295
298
|
/**
|
|
296
299
|
* 检测数值最大精度
|
|
@@ -445,6 +448,13 @@ export declare const findOne: (selector: string | HTMLElement, parent?: Document
|
|
|
445
448
|
*/
|
|
446
449
|
export declare const fixBaseUrl: (url: string, baseUrl: string) => string;
|
|
447
450
|
|
|
451
|
+
/**
|
|
452
|
+
* 将字符串转换为浮点数
|
|
453
|
+
* @param {string} str - 要转换的字符串
|
|
454
|
+
* @param {number} [defaultVal=0] - 转换失败时的默认值
|
|
455
|
+
*/
|
|
456
|
+
export declare const floatVal: (str: string, defaultVal?: number) => number;
|
|
457
|
+
|
|
448
458
|
/**
|
|
449
459
|
* 格式化日期(以 PHP 方式格式化)
|
|
450
460
|
* @param {string} format - 格式化字符串(支持 PHP date 函数的格式)
|
|
@@ -592,6 +602,13 @@ export declare const insertStyleSheet: (styleSheetStr: string, id?: string, doc?
|
|
|
592
602
|
*/
|
|
593
603
|
export declare const isBodyInit: (value: any) => value is BodyInit;
|
|
594
604
|
|
|
605
|
+
/**
|
|
606
|
+
* 判断字符串是否包含中文字符
|
|
607
|
+
* @param {string} str - 要判断的字符串
|
|
608
|
+
* @returns {boolean} 返回是否包含中文字符
|
|
609
|
+
*/
|
|
610
|
+
export declare const isChinese: (str: string) => boolean;
|
|
611
|
+
|
|
595
612
|
/**
|
|
596
613
|
* 判断对象是否为空
|
|
597
614
|
* @param obj - 要判断的对象
|
|
@@ -1435,11 +1452,13 @@ export declare const SELF_CLOSING_TAGS: string[];
|
|
|
1435
1452
|
* @param {string} value - Cookie 值
|
|
1436
1453
|
* @param {number} days - 有效天数,0 表示会话 Cookie
|
|
1437
1454
|
* @param {string} [path='/'] - Cookie 路径,默认为根路径
|
|
1455
|
+
* @param {string} [domain] - Cookie 域名
|
|
1438
1456
|
* @returns {void}
|
|
1439
1457
|
* @example
|
|
1440
1458
|
* setCookie('username', 'john', 7)
|
|
1459
|
+
* setCookie('username', 'john', 7, '/', '.example.com')
|
|
1441
1460
|
*/
|
|
1442
|
-
export declare const setCookie: (name: string, value: string, days: number, path?: string) => void;
|
|
1461
|
+
export declare const setCookie: (name: string, value: string, days: number, path?: string, domain?: string) => void;
|
|
1443
1462
|
|
|
1444
1463
|
/**
|
|
1445
1464
|
* 显示节点(通过设置 display 为空方式)
|