splitItem = (transaction, leftItem, diff) => {
  // create rightItem
  const {
    client,
    clock
  } = leftItem.id;
  const rightItem = new Item(createID(client, clock + diff), leftItem, createID(client, clock + diff - 1), leftItem.right, leftItem.rightOrigin, leftItem.parent, leftItem.parentSub, leftItem.content.splice(diff));

  if (leftItem.deleted) {
    rightItem.markDeleted();
  }

  if (leftItem.keep) {
    rightItem.keep = true;
  }

  if (leftItem.redone !== null) {
    rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff);
  } // update left (do not set leftItem.rightOrigin as it will lead to problems when syncing)


  leftItem.right = rightItem; // update right

  if (rightItem.right !== null) {
    rightItem.right.left = rightItem;
  } // right is more specific.


  transaction._mergeStructs.push(rightItem); // update parent._map


  if (rightItem.parentSub !== null && rightItem.right === null) {
    /** @type {AbstractType<any>} */
    rightItem.parent._map.set(rightItem.parentSub, rightItem);
  }

  leftItem.length = diff;
  return rightItem;
}
Split leftItem into two items
@param {Transaction} transaction
@param {Item} leftItem
@param {number} diff
@return {Item}

@function
@private