Does a JS type's prototype have a property
npm install --save is-proto-prop
import isProtoProp from 'is-proto-prop';
isProtoProp('array', 'length');
// => true
isProtoProp('Error', 'ignore');
// => false
// `is-proto-props` can only verify native JS types
isProtoProp('gulp', 'task');
// => false
Returns a Boolean
if propertyName
is on type
's prototype.
type: string
JS type to examine the prototype of. Note: is-proto-prop
only looks at native JS types.
type: string
Property name to look for on type
's prototype. Note: propertyName
is case sensitive.
MIT © Dustin Specker