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