npm.io
3.0.1 • Published 2 years ago

is-proto-prop

Licence
MIT
Version
3.0.1
Deps
2
Size
4 kB
Vulns
0
Weekly
0
Stars
1

is-proto-prop

NPM version Coverage Status

Code Climate

Does a JS type's prototype have a property

Install

npm install --save is-proto-prop

Usage

ES2015
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

API

isProtoProp(type, propertyName)

Returns a Boolean if propertyName is on type's prototype.

type

type: string

JS type to examine the prototype of. Note: is-proto-prop only looks at native JS types.

propertyName

type: string

Property name to look for on type's prototype. Note: propertyName is case sensitive.

LICENSE

MIT Dustin Specker

Keywords