2.1.0 • Published 8 years ago

check-props v2.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

check-props

basic type checking for javascript objects.

usage

const check = require('check');

const object_to_check = {
  foo: 0,
};

check.key('foo', 'string', object_to_check); // returns false
check.key('foo', 'number', object_to_check); // returns true

check.props({ foo: 'number', bar: 'string' }, object_to_check); // returns false

const advanced_object = {
  foo: 0,
  bar: 'super advanced feature',
};

check.props({ foo: 'number', bar: 'string' }, advanced_object); // returns true
2.1.0

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago