Package Exports
- hasprop
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hasprop) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hasprop
Check if object has property
Install
npm install hasprop
Usage
var hasProp = require('hasprop');
var foo = {
bar: {
baz: {
qux: 'corge',
c: [1,2]
},
garphly: [{a:'b'}]
},
fred: 'plugh'
};
hasProp(foo, 'bar') // true
hasProp(foo, 'foo') // false
hasProp(foo, 'bar.baz') // true
hasProp(foo, 'bar.baz.grault') // false
hasProp(foo, 'fred') // true
hasProp(foo, 'bar.garphly.0') // true
hasProp(foo, 'bar.garphly.0.a') // true
hasProp(foo, 'bar.baz.garphly.1') // false
hasProp(foo, 'bar.baz.corge.garphly.5') // false
hasProp(foo, 'bar.baz.c.1') // true
hasProp(foo, 'bar.baz.c.2') // false
License
MIT