object-path-get
Description
get values from javascript objects by specifying a path.
by using this library, you can help prevent the following error from occurring:
Cannot read property 'foo' of undefined
NOTE: I've re-written / used this function so many different times, I decided to publish it as a module.
Getting Started
Install the module with: npm install --save object-path-get
var getPath = ;var obj = foo: bar: 'baz' ;; // result: "baz"; // result: "cool"; // result: "baz" (with different delimiter); // result "baz" (with array path)
Links
Contributors
Thanks goes to these wonderful people (emoji key):
◬ 💻 📖 💡 |
danigb 💻 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
License
Copyright (c) 2014 skratchdot
Licensed under the MIT license.