@whitesev/utils 2.2.8 → 2.2.9

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.
@@ -863,7 +863,7 @@ declare class Utils {
863
863
  * Utils.isNotNull("123");
864
864
  * > true
865
865
  */
866
- isNotNull<T>(value: T | null): value is T;
866
+ isNotNull<T>(value: T | null | undefined): value is T;
867
867
  isNotNull(...args: any[]): boolean;
868
868
  /**
869
869
  * 判断对象或数据是否为空
@@ -910,7 +910,7 @@ declare class Utils {
910
910
  Utils.isNull(false,[123]);
911
911
  > false
912
912
  **/
913
- isNull<T>(value: T | null): value is null;
913
+ isNull<T>(value: T | undefined | null): value is null | undefined;
914
914
  isNull(...args: any[]): boolean;
915
915
  /**
916
916
  * 判断浏览器主题是否是暗黑|深色模式
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Utils.ts CHANGED
@@ -2106,7 +2106,7 @@ class Utils {
2106
2106
  * Utils.isNotNull("123");
2107
2107
  * > true
2108
2108
  */
2109
- isNotNull<T>(value: T | null): value is T;
2109
+ isNotNull<T>(value: T | null | undefined): value is T;
2110
2110
  isNotNull(...args: any[]): boolean;
2111
2111
  isNotNull(...args: any[]): boolean {
2112
2112
  let UtilsContext = this;
@@ -2157,7 +2157,7 @@ class Utils {
2157
2157
  Utils.isNull(false,[123]);
2158
2158
  > false
2159
2159
  **/
2160
- isNull<T>(value: T | null): value is null;
2160
+ isNull<T>(value: T | undefined | null): value is null | undefined;
2161
2161
  isNull(...args: any[]): boolean;
2162
2162
  isNull(...args: any[]): boolean {
2163
2163
  let result = true;
@@ -3911,7 +3911,9 @@ class Utils {
3911
3911
  /**
3912
3912
  * 将UrlSearchParams格式的字符串转为对象
3913
3913
  */
3914
- searchParamStrToObj<T extends any>(searhParamsStr?: string | null | undefined): T {
3914
+ searchParamStrToObj<T extends any>(
3915
+ searhParamsStr?: string | null | undefined
3916
+ ): T {
3915
3917
  if (typeof searhParamsStr !== "string") {
3916
3918
  // @ts-ignore
3917
3919
  return {};