function checkSortedOpIds(opIds) {
  let last = null
  for (let opId of opIds) {
    if (last && compareParsedOpIds(last, opId) !== -1) {
      throw new RangeError("operation IDs are not in ascending order")
    }
    last = opId
  }
}
Throws an exception if the opIds in the given array are not in sorted order.