0.1.0 • Published 9 years ago
obj-is v0.1.0
is-function's creator
Install
$ npm install --save obj-is
##Usage
var is = require('obj-is');
// Person Constructor
function Person(name) {
this.name = name;
}
// Create `isPerson` function
var isPerson = is(Person);
isPerson(new Person('foo')); // → true
isPerson({}); // → false
// if second argument set to true
// it's test with instanceof operator
var isObject = is(Object, true);
isObject(new Person('bar')); // → true
##Table of contents:
License
MIT © Ariel Mashraki