1.1.3 • Published 7 years ago

has-properties v1.1.3

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

has-properties Build Status

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