cosmetics

This commit is contained in:
D065023
2019-12-30 13:51:02 +01:00
parent 4a1887f424
commit 60563dc816

View File

@@ -14,14 +14,14 @@ const diff = (obj1, obj2) =>
const queriesToUpdateDifferences = (entity, ownEntries, otherEntries) => const queriesToUpdateDifferences = (entity, ownEntries, otherEntries) =>
ownEntries ownEntries
.map(ownEntry => { .map(ownEntry => {
const remoteAddress = otherEntries.find(otherEntry => const otherEntry = otherEntries.find(otherEntry =>
Object.keys(entity.keys).reduce( Object.keys(entity.keys).reduce(
(res, curr) => res && otherEntry[curr] === ownEntry[curr], (res, curr) => res && otherEntry[curr] === ownEntry[curr],
true true
) )
) )
if (remoteAddress) { if (otherEntry) {
const differences = diff(ownEntry, remoteAddress) const differences = diff(ownEntry, otherEntry)
if (Object.keys(differences).length) { if (Object.keys(differences).length) {
return UPDATE(entity) return UPDATE(entity)
.set(differences) .set(differences)