0.0.1 • Published 6 years ago

keycheck v0.0.1

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

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)

ParamDescription
objectvalid JSON object
keysdelimited string or array of strings

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

License

MIT

Free software, Hell Yeah