@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.
@@ -447,6 +447,9 @@ var Utils = (function () {
447
447
  }
448
448
  toJSON(data, errorCallBack) {
449
449
  let result = {};
450
+ if (data == null) {
451
+ return result;
452
+ }
450
453
  if (typeof data === "object") {
451
454
  return data;
452
455
  }
@@ -4316,13 +4319,25 @@ var Utils = (function () {
4316
4319
  * 获取字典所有的键
4317
4320
  */
4318
4321
  keys() {
4319
- return Array.from(this.items.keys());
4322
+ const keys = this.items.keys();
4323
+ if (typeof keys.toArray === "function") {
4324
+ return keys.toArray();
4325
+ }
4326
+ else {
4327
+ return [...keys];
4328
+ }
4320
4329
  }
4321
4330
  /**
4322
4331
  * 返回字典中的所有值
4323
4332
  */
4324
4333
  values() {
4325
- return Array.from(this.items.values());
4334
+ const values = this.items.values();
4335
+ if (typeof values.toArray === "function") {
4336
+ return values.toArray();
4337
+ }
4338
+ else {
4339
+ return [...values];
4340
+ }
4326
4341
  }
4327
4342
  /**
4328
4343
  * 清空字典
@@ -5499,7 +5514,7 @@ var Utils = (function () {
5499
5514
  }
5500
5515
  const domUtils = new DOMUtils();
5501
5516
 
5502
- const version = "2.9.7";
5517
+ const version = "2.9.9";
5503
5518
 
5504
5519
  class Utils {
5505
5520
  windowApi;
@@ -8037,7 +8052,7 @@ var Utils = (function () {
8037
8052
  }
8038
8053
  }
8039
8054
  /**
8040
- * 深度获取对象属性
8055
+ * 深度获取对象的某个属性
8041
8056
  * @param target 待获取的对象
8042
8057
  * @param handler 获取属性的回调
8043
8058
  */