function get (object, path) {
  if (typeof path === 'string') {
    if (isPath(path)) {
      return get(object, path.split('.'))
    } else {
      return object[path]
    }
  }

  let child = object

  for (let i = 0; i < path.length; i++) {
    const key = path[i]
    child = child ? child[key] : undefined
  }

  return child
}
Get a nested property from an object
@param {Object} object
@param {string | string[]} path
@returns {Object}