helpers/index.js
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]
}
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]
}
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 ] }
Create an object out of a nested path
Create an object out of a nested path