mixlea-utils-js 0.1.15 → 0.1.17

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.
@@ -462,7 +462,7 @@ export declare function extractWeightInfo(input: string): {
462
462
 
463
463
  export declare function extractWeightInfoToKg(spec: string): number | null;
464
464
 
465
- export declare function findDOMDataBubble(start: any, dataKey: string, end?: any): string | null | undefined;
465
+ export declare function findDOMDataBubble<T extends string>(start: any, dataKey: string, end?: any): T | null | undefined;
466
466
 
467
467
  export declare function findHtmlElementById(id: string, defaultValue?: HTMLElement): HTMLElement | null;
468
468
 
@@ -676,9 +676,9 @@ export declare function isDOM(element: any): any;
676
676
 
677
677
  /**
678
678
  * 判断数据是否为[null, undefind], 数组为空, 字符串为空, 对象为空
679
- * @param val
679
+ * @param input
680
680
  */
681
- export declare function isEmpty(val: any): boolean;
681
+ export declare function isEmpty(input: any): input is VoidLike_2;
682
682
 
683
683
  export declare function isEmptyString(value: any): boolean;
684
684
 
@@ -706,9 +706,9 @@ export declare function isMoreThanZero(val: any): boolean;
706
706
 
707
707
  /**
708
708
  * 判断数据是否不为[null, undefind], 数组不为空, 字符串不为空, 对象不为空
709
- * @param val
709
+ * @param input
710
710
  */
711
- export declare function isNotEmpty(val: any): boolean;
711
+ export declare function isNotEmpty<T>(input: T): input is Exclude<T, VoidLike_3>;
712
712
 
713
713
  export declare function isNotEmptyArray(arr: any): arr is Array<any>;
714
714
 
@@ -722,7 +722,7 @@ export declare function isNotPlainObject(val: any): boolean;
722
722
 
723
723
  export declare function isNotUndefined(value: any): boolean;
724
724
 
725
- export declare function isNotVoid(value: any): boolean;
725
+ export declare function isNotVoid(input: any): input is Exclude<unknown, VoidLike_4>;
726
726
 
727
727
  export declare function isNullish<T>(value: T | null | undefined): value is null | undefined;
728
728
 
@@ -765,7 +765,7 @@ export declare function isValidDate(input: any): input is Date;
765
765
 
766
766
  export declare function isValidNumber(val: any): boolean;
767
767
 
768
- export declare function isVoid(val: any): boolean;
768
+ export declare function isVoid(input: any): input is VoidLike;
769
769
 
770
770
  export declare function isWebViewBrowser(): boolean;
771
771
 
@@ -1385,6 +1385,14 @@ declare type ValueOrFn<T> = T | (() => T);
1385
1385
 
1386
1386
  declare type ValueOrFn_2<T> = T | (() => T);
1387
1387
 
1388
+ declare type VoidLike = null | undefined | '' | [];
1389
+
1390
+ declare type VoidLike_2 = null | undefined | '' | [] | Record<string, never>;
1391
+
1392
+ declare type VoidLike_3 = null | undefined | '' | [] | Record<string, never>;
1393
+
1394
+ declare type VoidLike_4 = null | undefined | '' | [];
1395
+
1388
1396
  export declare function when<V>(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): {
1389
1397
  elseWhen(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): any;
1390
1398
  default(defaultResult: ValueOrFn_2<V>): V;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mixlea-utils-js",
3
3
  "type": "module",
4
- "version": "0.1.15",
4
+ "version": "0.1.17",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",
7
7
  "exports": {