diff --git a/src/syncImpl/LSSync.ts b/src/syncImpl/LSSync.ts index fb46a62..eaad109 100644 --- a/src/syncImpl/LSSync.ts +++ b/src/syncImpl/LSSync.ts @@ -1,12 +1,14 @@ -import { LogootSDel, LogootSOperation } from "mute-structs"; -import { Sync } from "../core"; +import { LogootSDel, LogootSOperation } from 'mute-structs' +import { Sync } from '../core' export class LSSync extends Sync { - computeDependencies ({ lid }: LogootSDel): Map { + computeDependencies(op: LogootSOperation): Map { const map = new Map() - lid.forEach(({ idBegin: { replicaNumber } }) => { - map.set(replicaNumber, this.vector.get(replicaNumber)) - }) + if (op instanceof LogootSDel) { + op.lid.forEach(({ idBegin: { replicaNumber } }) => { + map.set(replicaNumber, this.vector.get(replicaNumber)) + }) + } return map } -} \ No newline at end of file +}