@whitesev/utils 2.4.3 → 2.4.4
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.amd.js +18 -1
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +18 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +18 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +18 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +18 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +17 -0
- package/package.json +1 -1
- package/src/Utils.ts +35 -1
package/dist/index.umd.js
CHANGED
|
@@ -4078,7 +4078,7 @@
|
|
|
4078
4078
|
this.windowApi = new WindowApi(option);
|
|
4079
4079
|
}
|
|
4080
4080
|
/** 版本号 */
|
|
4081
|
-
version = "2024.
|
|
4081
|
+
version = "2024.11.1";
|
|
4082
4082
|
addStyle(cssText) {
|
|
4083
4083
|
if (typeof cssText !== "string") {
|
|
4084
4084
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -7096,6 +7096,23 @@
|
|
|
7096
7096
|
});
|
|
7097
7097
|
}
|
|
7098
7098
|
}
|
|
7099
|
+
/**
|
|
7100
|
+
* 深度获取对象属性
|
|
7101
|
+
* @param target 待获取的对象
|
|
7102
|
+
* @param handler 获取属性的回调
|
|
7103
|
+
*/
|
|
7104
|
+
queryProperty(target, handler) {
|
|
7105
|
+
if (target == null) {
|
|
7106
|
+
return;
|
|
7107
|
+
}
|
|
7108
|
+
let handleResult = handler(target);
|
|
7109
|
+
if (handleResult &&
|
|
7110
|
+
typeof handleResult.isFind === "boolean" &&
|
|
7111
|
+
handleResult.isFind) {
|
|
7112
|
+
return handleResult.data;
|
|
7113
|
+
}
|
|
7114
|
+
return this.queryProperty(handleResult.data, handler);
|
|
7115
|
+
}
|
|
7099
7116
|
/**
|
|
7100
7117
|
* 创建一个新的Utils实例
|
|
7101
7118
|
* @param option
|