keys-in
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i keys-in

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

124 kB

Total Files

12

Last publish

Collaborators

  • potato4d