Skip to content

resolveConflicts

function resolveConflicts(records, strategy?): ResolveResult;

Defined in: ledger-conflict.ts:235

Reduce a set of records to a conflict-free subset using strategy. Records are considered in chronological order; each candidate is kept unless it conflicts with an already-kept record, in which case strategy decides the winner (a winning candidate evicts the records it beats). Greedy and deterministic — the same inputs always yield the same result.

This is the “drop one side” path. To keep both sides by transforming positions instead, use rebaseRecords from ledger-rebase.ts.

ParameterTypeDefault value
recordsreadonly LedgerRecord[]undefined
strategyConflictStrategylastWriteWins

ResolveResult