cosmetics
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user