function copyObject(obj) {
  if (!isObject(obj)) return {}
  let copy = {}
  for (let key of Object.keys(obj)) {
    copy[key] = obj[key]
  }
  return copy
}
Returns a shallow copy of the object `obj`. Faster than `Object.assign({}, obj)`.
https://jsperf.com/cloning-large-objects/1