151
}
152
153
>
function compare(from: IStringDictionary<string> | null, to: IStringDictionary<string> | null): { added: Set<string>; removed: Set<string>; updated: Set<string> } {
snippetsMerge.ts
154
>
const fromKeys = from ? Object.keys(from) : [];
155
>
const toKeys = to ? Object.keys(to) : [];
156
>
const added = toKeys.filter(key => !fromKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
157
>
const removed = fromKeys.filter(key => !toKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
158
>
const updated: Set<string> = new Set<string>();
159
>
160
>
for (const key of fromKeys) {
161
if (removed.has(key)) {
162
continue;