lodash-getpath
v0.2.4
Published
A lodash plugin/extension/mixin for _.get, which allows intuitive paths eg. 'name[0,1]' and 'a.b[].x[-1].z'
Downloads
15,724
Maintainers
Readme
lodash-getpath
A lodash plugin/extension/mixin for _.get, which allows intuitive paths eg. 'name[0,1]' and 'a.b[].x[-1].z'
What for?
Above-and-beyond pathing syntax for nested-Array properties:
- +/-ve index --> returns value from start/end of Array
[0,1,-2]
list of indexes --> returns a (spliced) Array[]
all indexes --> returns a (whole) Array
Install
npm install --save lodash-getpath
Usage
Also available in the browser as simply _getPath()
in the global context/window
Currently built using lodash ^4.0.0