Skip to content
/ keycheck Public

Check for the existence of specified keys in an object

License

Notifications You must be signed in to change notification settings

m8r1x/keycheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keycheck

Checks for the existence of specified keys in an object

Installation

$ npm install keycheck

Usage

const keycheck = require("keycheck");
// ts: import * as keycheck from "keycheck";

const user = {
  firstName: "willie",
  lastName: "m.i.k."
};

const keys = ["firstName", "lastName", "age"]; // or "firstName lastName age"
const result = keycheck(user, keys);

// { firstName: true, lastName: true, age: false }

API

keycheck(object, keys)

Param Description
object valid JSON object
keys delimited string or array of strings

NOTE: Any character can be used as a delimiter except - and _.

License

MIT

Free software, Hell Yeah

About

Check for the existence of specified keys in an object

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published