Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/is-obj-prop
Does a JS type have a property
https://github.com/dustinspecker/is-obj-prop
Last synced: 2 days ago
JSON representation
Does a JS type have a property
- Host: GitHub
- URL: https://github.com/dustinspecker/is-obj-prop
- Owner: dustinspecker
- License: mit
- Created: 2016-10-01T22:53:38.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T13:06:53.000Z (5 months ago)
- Last Synced: 2024-10-14T06:01:14.510Z (25 days ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 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-obj-prop
[![NPM version](https://badge.fury.io/js/is-obj-prop.svg)](https://badge.fury.io/js/is-obj-prop) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/is-obj-prop.svg)](https://coveralls.io/r/dustinspecker/is-obj-prop?branch=main) [![Code Climate](https://codeclimate.com/github/dustinspecker/is-obj-prop/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/is-obj-prop)> Does a JS type have a property
## Install
```
npm install --save is-obj-prop
```## Usage
### ES2015
```javascript
import isObjProp from 'is-obj-prop';isObjProp('array', 'length');
// => trueisObjProp('ARRAY', 'push');
// => false// is-obj-prop can only verify native JS types
isObjProp('gulp', 'task');
// => false;
```## API
### isObjProp(type, propertyName)
#### type
Type: `string`A native JS type to examine. Note: `is-obj-prop` can only verify native JS types.
#### propertyName
Type: `string`Property name to determine if a property of `type`.
## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)