Skip to content

Commit

Permalink
fix(lssyncmessage): fix type for accumulator in serializeRichOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricenclos committed Dec 5, 2018
1 parent dd1359f commit aa858cf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/crdtImpl/LogootSplit/LSSyncMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ export class LSSyncMessage extends SyncMessage<LogootSOperation> {
richOperation: RichOperation<LogootSOperation>
): proto.RichOperationMsg {
const { id, clock, operation: logootSOp, dependencies } = richOperation
const d = Array.from(dependencies).reduce((acc: object, v) => {
const key: string = v[0] + ''
const obj = Object.create({})
obj[key] = v[1]
return { ...acc, ...obj }
}, {})
const d: { [k: string]: number } = Array.from(dependencies).reduce(
(acc: { [k: string]: number }, v) => {
const key: string = v[0] + ''
const obj = Object.create({})
obj[key] = v[1]
return { ...acc, ...obj }
},
{}
)
const logootMsg = proto.RichLogootSOperationMsg.create({ id, clock, dependencies: d })

const res = proto.RichOperationMsg.create({ richLogootSOpsMsg: logootMsg })
Expand Down

0 comments on commit aa858cf

Please sign in to comment.