Merge branch '19177-sharing-urls-ui-config'. Closes #19177
[arvados-workbench2.git] / src / common / objects.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4 import { union, keys as keys_1, filter } from "lodash";
5
6 export function getModifiedKeys(a: any, b: any) {
7     const keys = union(keys_1(a), keys_1(b));
8     return filter(keys, key => a[key] !== b[key]);
9 }
10
11 export function getModifiedKeysValues(a: any, b: any) {
12     const keys = getModifiedKeys(a, b);
13     const obj = {};
14     keys.forEach(k => {
15         obj[k] = a[k];
16     });
17     return obj;
18 }