17426: Add dialog box with form to example plugin.
[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 * as _ from "lodash";
5
6 export function getModifiedKeys(a: any, b: any) {
7     const keys = _.union(_.keys(a), _.keys(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 }