1.0.0 • Published 10 years ago
value-get v1.0.0
value-get 
Create functional property getters
Install
$ npm install --save value-getUsage
var get = require('value-get')
get('foo', {foo: 'bar'})
//=> bar
var getFoo = get('foo')
getFoo({foo: 'bar'})
//=> bar
var getDeepBar = get('foo.bar')
getDeepBar({foo: {bar: 'baz'}})
//=> bazAPI
get(path, [obj]) -> any
path
Required
Type: string
The string key path. The path can be a normal key or use dot property syntax for deep access. If you need an actual dot, escape it:
get('foo\\.bar', {'foo.bar': 'baz'})
//=> bazobj
Type: object
The object to get the value from. If no object is supplied, a partially applied function with the path will be returned.
License
MIT © Ben Drucker
1.0.0
10 years ago