code: function nestedPath (obj, path, val) {
    if (typeof obj !== 'object') {
      return obj
    }
    var keys = path.split('.')
    if (keys.length > 1) {
      path = keys.shift()
      return nestedPath(obj[path], keys.join('.'), val)
    }
    if (val !== undefined) {
      obj[path] = val
    }
    return obj[path]
  }
docs: Create an object out of a nested path