has-properties
v1.1.3
Published
Checks if the given object has the required/mandatory properties.
Downloads
10
Maintainers
Readme
has-properties
Checks if the given object has the required/mandatory properties.
Install
$ npm install --save has-properties
Usage
var positive = {
name: 'Kitty',
age: 42,
type: 'Cat'
};
var negative = {
name: 'Kitty',
age: 24
}
var mandatory = ['name', 'type'];
hasProperties(positive, mandatory) // true
hasProperties(negative, mandatory) // false
License
MIT © Hemanth.HM