8000 GitHub - m8r1x/keycheck: Check for the existence of specified keys in an object · GitHub
[go: up one dir, main page]

Skip to content
m8r1xPublic

About

Check for the existence of specified keys in an object

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0