296
}
297
298
>
function compare(from: IStringDictionary<any> | null, to: IStringDictionary<any>, ignored: Set<string>): { added: Set<string>; removed: Set<string>; updated: Set<string> } {
settingsMerge.ts
299
>
const fromKeys = from ? Object.keys(from).filter(key => !ignored.has(key)) : [];
300
>
const toKeys = Object.keys(to).filter(key => !ignored.has(key));
301
>
const added = toKeys.filter(key => !fromKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
302
>
const removed = fromKeys.filter(key => !toKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
303
>
const updated: Set<string> = new Set<string>();
304
>
305
>
if (from) {
306
>
for (const key of fromKeys) {
307
if (removed.has(key)) {
308
continue;