@zhongguo168a/yxeditor-common 0.0.172 → 0.0.173
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.d.ts +7 -0
- package/dist/index.esm.js +20 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1141,6 +1141,13 @@ declare class MapUtil {
|
|
|
1141
1141
|
unflat(object: {
|
|
1142
1142
|
[key: string]: any;
|
|
1143
1143
|
}, split?: string): any;
|
|
1144
|
+
/**
|
|
1145
|
+
* 返回键值相同的对象,只遍历一层,比较前使用flag展开
|
|
1146
|
+
* @param a
|
|
1147
|
+
* @param b
|
|
1148
|
+
* @returns
|
|
1149
|
+
*/
|
|
1150
|
+
sample(a: any, b: any): any;
|
|
1144
1151
|
/**
|
|
1145
1152
|
* 比较两个对象,包括基础类型
|
|
1146
1153
|
* @param a
|
package/dist/index.esm.js
CHANGED
|
@@ -1550,6 +1550,26 @@ class MapUtil {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
return result;
|
|
1552
1552
|
}
|
|
1553
|
+
/**
|
|
1554
|
+
* 返回键值相同的对象,只遍历一层,比较前使用flag展开
|
|
1555
|
+
* @param a
|
|
1556
|
+
* @param b
|
|
1557
|
+
* @returns
|
|
1558
|
+
*/
|
|
1559
|
+
sample(a, b) {
|
|
1560
|
+
let result = {};
|
|
1561
|
+
for (const key in a) {
|
|
1562
|
+
let bval = b[key];
|
|
1563
|
+
if (bval == undefined) {
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
let aval = a[key];
|
|
1567
|
+
if (aval == bval) {
|
|
1568
|
+
result[key] = aval;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
return result;
|
|
1572
|
+
}
|
|
1553
1573
|
/**
|
|
1554
1574
|
* 比较两个对象,包括基础类型
|
|
1555
1575
|
* @param a
|