updateSibling = (
  blockMap: BlockMap,
  prevKey: string,
  nextKey: string,
): BlockMap => {
  const prevSibling = blockMap.get(prevKey);
  const nextSibling = blockMap.get(nextKey);
  invariant(
    prevSibling != null && nextSibling != null,
    'siblings should exist in the block map',
  );
  const newBlocks: {[string]: $FlowFixMe} = {};
  newBlocks[prevKey] = prevSibling.merge({
    nextSibling: nextKey,
  });
  newBlocks[nextKey] = nextSibling.merge({
    prevSibling: prevKey,
  });
  return blockMap.merge(newBlocks);
}
This is a utility method for setting B as the next sibling of A, ensuring
that sibling operations are correctly mirrored

The block map returned by this method may not be a valid tree (parent/child/
other siblings are unaffected)