Socket
Book a DemoInstallSign in
Socket

assert-has-keys

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assert-has-keys

Assert that an object has specific properties

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

assert-has-keys Build Status

Assert that an object has specific properties

Install

$ npm install --save assert-has-keys

Usage

var assertHasKeys = require('assert-has-keys');

assertHasKeys({foo: 'bar'}, 'foo');
assertHasKeys({foo: 'bar'}, ['foo']);
assertHasKeys({foo: 'bar', bar: 'foo'}, ['bar', 'foo']);
//=> All do nothing

assertHasKeys({foo: 'bar', bar: 'foo'}, 'foobar');
assertHasKeys({foo: 'bar', bar: 'foo'}, ['foo', 'bar', 'foobar']);
//=> Will all throw an AssertionError

License

MIT © Arthur Verschaeve

Keywords

keys

FAQs

Package last updated on 07 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts