How to calculate the changed ranges for transactions

Got it!

transaction.mapping.maps.forEach((stepMap, index) => {
  stepMap.forEach((from, to) => {
    const newStart = transaction.mapping.slice(index).map(from, -1)
    const newEnd = transaction.mapping.slice(index).map(to)
    const oldStart = transaction.mapping.invert().map(newStart, -1)
    const oldEnd = transaction.mapping.invert().map(newEnd)
  })
})
3 Likes