function updateMapObject(patch, obj, updated) {
  const objectId = patch.objectId
  if (!updated[objectId]) {
    updated[objectId] = cloneMapObject(obj, objectId)
  }

  const object = updated[objectId]
  applyProperties(patch.props, object, object[CONFLICTS], updated)
  return object
}
Updates the map object `obj` according to the modifications described in
`patch`, or creates a new object if `obj` is undefined. Mutates `updated`
to map the objectId to the new object, and returns the new object.