@yavisht/has-key
v1.1.0
Published
Returns true if the object has a key
Downloads
2
Readme
HasKey - Does the object have the key?
A simple util that will return true or false if the specified key is present in the object supplied.
What's New?
- Package now available on NPM and Github Package Registry
Installation
// NPM
npm i @yavisht/has-key
// Yarn
yarn add @yavisht/has-key
Usage
// require example
const hasKey = require('@yavisht/has-key')
// import example
import hasKey from '@yavisht/has-key'
// returns true
console.log(hasKey({foo:'bar'}, 'foo'))
// returns false
console.log(hasKey({foo:'bar'}, 'bar'))