law-common 1.2.5 → 1.2.6

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.
@@ -3,3 +3,4 @@ export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (inp
3
3
  export declare function convertMapToObject<K, T>(map: Map<K, T>): {
4
4
  [key: string]: T;
5
5
  };
6
+ export declare function removeSamePropertyValues(source: any, target: any): void;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.groupByFunction = groupByFunction;
4
4
  exports.groupByOneToOneFunction = groupByOneToOneFunction;
5
5
  exports.convertMapToObject = convertMapToObject;
6
+ exports.removeSamePropertyValues = removeSamePropertyValues;
6
7
  function groupByFunction(list, keyGetter) {
7
8
  const map = new Map();
8
9
  list.forEach((item) => {
@@ -28,3 +29,10 @@ function groupByOneToOneFunction(list, keyGetter) {
28
29
  function convertMapToObject(map) {
29
30
  return Object.fromEntries(map);
30
31
  }
32
+ function removeSamePropertyValues(source, target) {
33
+ for (let key in target) {
34
+ if (source[key] && source[key] === target[key]) {
35
+ delete target[key];
36
+ }
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [