Checks if path is a direct property of object.
$ npm install --save object-has
For more use-cases see the tests
var has = require('object-has'); var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; has(object, 'a[0].b.c'); // => true has(object, 'a[1]'); // => true has(object); // => false has(['a', 'b', 'c'], 2); // => true has({ a: 'abcde' }, 'a[1]'); // => false has({ a: ['abcde'] }, 'a[0][2]'); // => true
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