(x: Op, y: Op)
| 686 | | { readonly _tag: "remove"; readonly key: unknown } |
| 687 | |
| 688 | const compose = (x: Op, y: Op): Op => { |
| 689 | if (y._tag !== "patch") return y |
| 690 | switch (x._tag) { |
| 691 | case "set": |
| 692 | return { _tag: "set", row: { ...x.row, ...y.fields } } |
| 693 | case "patch": |
| 694 | return { _tag: "patch", key: y.key, fields: { ...x.fields, ...y.fields } } |
| 695 | case "remove": |
| 696 | return x |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | const resolve = (entry: Op, conflicts: ReadonlyArray<{ readonly payload: Op }>): Op | undefined => { |
| 701 | if (conflicts.length === 0) return entry |
no outgoing calls
no test coverage detected