d2aura 23.0.39 → 23.0.40
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.
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
type Customizer = (key: string, value: any, other: any) => boolean | undefined;
|
|
1
2
|
export default class EntityComparisonUtils {
|
|
2
|
-
static compare(obj1?: Record<string, any>, obj2?: Record<string, any
|
|
3
|
+
static compare(obj1?: Record<string, any>, obj2?: Record<string, any>, customizer?: Customizer): string[];
|
|
3
4
|
}
|
|
5
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { union, isEqualWith } from "lodash";
|
|
2
2
|
export default class EntityComparisonUtils {
|
|
3
|
-
static compare(obj1, obj2) {
|
|
3
|
+
static compare(obj1, obj2, customizer) {
|
|
4
4
|
if (!obj1)
|
|
5
5
|
obj1 = {};
|
|
6
6
|
if (!obj2)
|
|
7
7
|
obj2 = {};
|
|
8
8
|
const keys = union(Object.keys(obj1), Object.keys(obj2));
|
|
9
|
-
return keys
|
|
9
|
+
return keys
|
|
10
|
+
.filter(key => !isEqualWith(obj1[key], obj2[key], (value, other) => customizer?.(key, value, other)));
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=entityComparisonUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityComparisonUtils.js","sourceRoot":"","sources":["../../../../api/comparison/entityComparisonUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"entityComparisonUtils.js","sourceRoot":"","sources":["../../../../api/comparison/entityComparisonUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,QAAQ,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAEtC,MAAM,CAAC,OAAO,CAAC,IAA0B,EAAE,IAA0B,EAAE,UAAuB;QAC1F,IAAI,CAAC,IAAI;YAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI;YAAE,IAAI,GAAG,EAAE,CAAC;QAErB,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,OAAO,IAAI;aACN,MAAM,CAAC,GAAG,CAAC,EAAE,CACV,CAAC,WAAW,CACR,IAAI,CAAC,GAAG,CAAC,EACT,IAAI,CAAC,GAAG,CAAC,EACT,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CACpD,CACJ,CAAC;IACV,CAAC;CAEJ","sourcesContent":["import {union, isEqualWith} from \"lodash\";\r\n\r\ntype Customizer = (key: string, value: any, other: any) => boolean | undefined;\r\n\r\nexport default class EntityComparisonUtils {\r\n\r\n static compare(obj1?: Record<string, any>, obj2?: Record<string, any>, customizer?: Customizer): string[] {\r\n if (!obj1) obj1 = {};\r\n if (!obj2) obj2 = {};\r\n\r\n const keys = union(Object.keys(obj1), Object.keys(obj2));\r\n return keys\r\n .filter(key =>\r\n !isEqualWith(\r\n obj1[key],\r\n obj2[key],\r\n (value, other) => customizer?.(key, value, other)\r\n )\r\n );\r\n }\r\n\r\n}"]}
|