@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.amd.js +19 -4
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +19 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +19 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +19 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +19 -4
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +19 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Utils.d.ts +6 -2
- package/package.json +9 -9
- package/src/CommonUtil.ts +3 -0
- package/src/Dictionary.ts +12 -2
- package/src/Utils.ts +7 -2
package/dist/index.amd.js
CHANGED
|
@@ -446,6 +446,9 @@ define((function () { 'use strict';
|
|
|
446
446
|
}
|
|
447
447
|
toJSON(data, errorCallBack) {
|
|
448
448
|
let result = {};
|
|
449
|
+
if (data == null) {
|
|
450
|
+
return result;
|
|
451
|
+
}
|
|
449
452
|
if (typeof data === "object") {
|
|
450
453
|
return data;
|
|
451
454
|
}
|
|
@@ -4315,13 +4318,25 @@ define((function () { 'use strict';
|
|
|
4315
4318
|
* 获取字典所有的键
|
|
4316
4319
|
*/
|
|
4317
4320
|
keys() {
|
|
4318
|
-
|
|
4321
|
+
const keys = this.items.keys();
|
|
4322
|
+
if (typeof keys.toArray === "function") {
|
|
4323
|
+
return keys.toArray();
|
|
4324
|
+
}
|
|
4325
|
+
else {
|
|
4326
|
+
return [...keys];
|
|
4327
|
+
}
|
|
4319
4328
|
}
|
|
4320
4329
|
/**
|
|
4321
4330
|
* 返回字典中的所有值
|
|
4322
4331
|
*/
|
|
4323
4332
|
values() {
|
|
4324
|
-
|
|
4333
|
+
const values = this.items.values();
|
|
4334
|
+
if (typeof values.toArray === "function") {
|
|
4335
|
+
return values.toArray();
|
|
4336
|
+
}
|
|
4337
|
+
else {
|
|
4338
|
+
return [...values];
|
|
4339
|
+
}
|
|
4325
4340
|
}
|
|
4326
4341
|
/**
|
|
4327
4342
|
* 清空字典
|
|
@@ -5498,7 +5513,7 @@ define((function () { 'use strict';
|
|
|
5498
5513
|
}
|
|
5499
5514
|
const domUtils = new DOMUtils();
|
|
5500
5515
|
|
|
5501
|
-
const version = "2.9.
|
|
5516
|
+
const version = "2.9.9";
|
|
5502
5517
|
|
|
5503
5518
|
class Utils {
|
|
5504
5519
|
windowApi;
|
|
@@ -8036,7 +8051,7 @@ define((function () { 'use strict';
|
|
|
8036
8051
|
}
|
|
8037
8052
|
}
|
|
8038
8053
|
/**
|
|
8039
|
-
*
|
|
8054
|
+
* 深度获取对象的某个属性
|
|
8040
8055
|
* @param target 待获取的对象
|
|
8041
8056
|
* @param handler 获取属性的回调
|
|
8042
8057
|
*/
|