@whitesev/utils 2.9.7 → 2.9.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.
package/dist/index.esm.js CHANGED
@@ -444,6 +444,9 @@ class CommonUtil {
444
444
  }
445
445
  toJSON(data, errorCallBack) {
446
446
  let result = {};
447
+ if (data == null) {
448
+ return result;
449
+ }
447
450
  if (typeof data === "object") {
448
451
  return data;
449
452
  }
@@ -4313,13 +4316,25 @@ class UtilsDictionary {
4313
4316
  * 获取字典所有的键
4314
4317
  */
4315
4318
  keys() {
4316
- return Array.from(this.items.keys());
4319
+ const keys = this.items.keys();
4320
+ if (typeof keys.toArray === "function") {
4321
+ return keys.toArray();
4322
+ }
4323
+ else {
4324
+ return [...keys];
4325
+ }
4317
4326
  }
4318
4327
  /**
4319
4328
  * 返回字典中的所有值
4320
4329
  */
4321
4330
  values() {
4322
- return Array.from(this.items.values());
4331
+ const values = this.items.values();
4332
+ if (typeof values.toArray === "function") {
4333
+ return values.toArray();
4334
+ }
4335
+ else {
4336
+ return [...values];
4337
+ }
4323
4338
  }
4324
4339
  /**
4325
4340
  * 清空字典
@@ -5496,7 +5511,7 @@ class DOMUtils {
5496
5511
  }
5497
5512
  const domUtils = new DOMUtils();
5498
5513
 
5499
- const version = "2.9.7";
5514
+ const version = "2.9.9";
5500
5515
 
5501
5516
  class Utils {
5502
5517
  windowApi;
@@ -8034,7 +8049,7 @@ class Utils {
8034
8049
  }
8035
8050
  }
8036
8051
  /**
8037
- * 深度获取对象属性
8052
+ * 深度获取对象的某个属性
8038
8053
  * @param target 待获取的对象
8039
8054
  * @param handler 获取属性的回调
8040
8055
  */