0.1.1 • Published 6 years ago

keys-in v0.1.1

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

keys-in

codecov

Simple object key existence check Library

Installation

# use NPM
$ npm install -S keys-in

# use Yarn
$ yarn add keys-in

Usage

keysIn(payload: object, keys: string[]): boolean

import keysIn from 'keys-in'

const payload = { name: 'potato4d' }
const keys = ['name', 'email']

console.log(keysIn(payload, keys))
// false

payload.email = 'mail@potato4d.me'

console.log(keysIn(payload, keys))
// true

Contribution

# Install package
$ yarn

# Run test
$ yarn test

# Run test with coverage
$ yarn test:coverage

LICENSE

MIT