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