Get object's property according to the path.
$ npm install --save object-at
For more use-cases see the tests
var at = require('object-at'); var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; at(object, 'a[0].b.c'); // => 3 at(object, 'a[1]'); // => 4 at(['a', 'b', 'c'], 2); // => 'c' at(); // => undefined at(['a', 'b', 'c']); // => undefined at(['a', 'b', 'c'], 5); // => undefined at(['a', 'b', 'c'], '1.2'); // => undefined
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4