minimizeAttributeChanges = (currPos, attributes) => {
  // go right while attributes[right.key] === right.value (or right is deleted)
  while (true) {
    if (currPos.right === null) {
      break;
    } else if (currPos.right.deleted || currPos.right.content.constructor === ContentFormat && equalAttrs(attributes[
    /** @type {ContentFormat} */
    currPos.right.content.key] || null,
    /** @type {ContentFormat} */
    currPos.right.content.value)) ;else {
      break;
    }

    currPos.forward();
  }
}
@param {ItemTextListPosition} currPos
@param {Object<string,any>} attributes

@private
@function