包详细信息

is-obj-prop

dustinspecker872.6kMIT2.0.0

Does a JS type have a property

js, javascript, object, property

自述文件

is-obj-prop

NPM version Coverage Status Code Climate

Does a JS type have a property

Install

npm install --save is-obj-prop

Usage

ES2015

import isObjProp from 'is-obj-prop';

isObjProp('array', 'length');
// => true

isObjProp('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