transform method

Delta transform(
  1. Delta other,
  2. bool priority
)

Transforms other delta against operations in this delta.

Implementation

Delta transform(Delta other, bool priority) {
  final result = Delta();
  final thisIter = DeltaIterator(this);
  final otherIter = DeltaIterator(other);

  while (thisIter.hasNext || otherIter.hasNext) {
    final newOp = _transformOperation(thisIter, otherIter, priority);
    if (newOp != null) result.push(newOp);
  }
  return result..trim();
}