@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.iife.js
CHANGED
|
@@ -4075,7 +4075,7 @@ var Utils = (function () {
|
|
|
4075
4075
|
this.windowApi = new WindowApi(option);
|
|
4076
4076
|
}
|
|
4077
4077
|
/** 版本号 */
|
|
4078
|
-
version = "2024.
|
|
4078
|
+
version = "2024.11.1";
|
|
4079
4079
|
addStyle(cssText) {
|
|
4080
4080
|
if (typeof cssText !== "string") {
|
|
4081
4081
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -7093,6 +7093,23 @@ var Utils = (function () {
|
|
|
7093
7093
|
});
|
|
7094
7094
|
}
|
|
7095
7095
|
}
|
|
7096
|
+
/**
|
|
7097
|
+
* 深度获取对象属性
|
|
7098
|
+
* @param target 待获取的对象
|
|
7099
|
+
* @param handler 获取属性的回调
|
|
7100
|
+
*/
|
|
7101
|
+
queryProperty(target, handler) {
|
|
7102
|
+
if (target == null) {
|
|
7103
|
+
return;
|
|
7104
|
+
}
|
|
7105
|
+
let handleResult = handler(target);
|
|
7106
|
+
if (handleResult &&
|
|
7107
|
+
typeof handleResult.isFind === "boolean" &&
|
|
7108
|
+
handleResult.isFind) {
|
|
7109
|
+
return handleResult.data;
|
|
7110
|
+
}
|
|
7111
|
+
return this.queryProperty(handleResult.data, handler);
|
|
7112
|
+
}
|
|
7096
7113
|
/**
|
|
7097
7114
|
* 创建一个新的Utils实例
|
|
7098
7115
|
* @param option
|