Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/is-proto-prop
Does a JS type's prototype have a property
https://github.com/dustinspecker/is-proto-prop
Last synced: 2 days ago
JSON representation
Does a JS type's prototype have a property
- Host: GitHub
- URL: https://github.com/dustinspecker/is-proto-prop
- Owner: dustinspecker
- License: mit
- Created: 2015-11-01T01:59:48.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T01:58:38.000Z (6 months ago)
- Last Synced: 2024-05-23T02:22:51.739Z (6 months ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# is-proto-prop
[![NPM version](https://badge.fury.io/js/is-proto-prop.svg)](https://badge.fury.io/js/is-proto-prop) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/is-proto-prop.svg)](https://coveralls.io/r/dustinspecker/is-proto-prop?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/is-proto-prop/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/is-proto-prop)
> Does a JS type's prototype have a property
## Install
```
npm install --save is-proto-prop
```## Usage
### ES2015
```javascript
import isProtoProp from 'is-proto-prop';isProtoProp('array', 'length');
// => trueisProtoProp('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](https://github.com/dustinspecker)