Comparing version 2.0.0 to 2.1.0
@@ -35,3 +35,3 @@ /*! | ||
VERSION: '2.0.0', | ||
VERSION: '2.1.0', | ||
@@ -132,3 +132,15 @@ // OPERATORS | ||
/** | ||
* Is the subject an instance of the standard? | ||
* | ||
* @method instanceOf | ||
* @param {Object} subject | ||
* @param {Object} standard, optional, defaults to 0 | ||
*/ | ||
instanceOf: function(x, y) { | ||
return is.present(y) && x instanceof y | ||
}, | ||
// PRIMITIVES | ||
@@ -411,2 +423,3 @@ | ||
is.lte = is.lessThanOrEqualTo | ||
is.inst = is.instanceOf | ||
@@ -413,0 +426,0 @@ is.fn = is.func |
{ | ||
"name": "is-too", | ||
"description": "simple validations", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"keywords": [ | ||
"is", | ||
"is-too", | ||
"type", | ||
"validation" | ||
], | ||
"homepage": "http://github.com/LoudBit/is", | ||
"homepage": "http://github.com/LoudBit/is-too", | ||
"author": "Darcy Murphy <mrDarcyMurphy@gmail.com> (http://github.com/mrDarcyMurphy)", | ||
@@ -13,0 +12,0 @@ "repository": { |
@@ -45,8 +45,8 @@ // asserts | ||
notStandard: function(method, keysThatPass, standard) { | ||
notStandard: function(method, keysThatFail, standard) { | ||
subjectKeys.forEach(function(key){ | ||
if ( keysThatPass.indexOf(key) > -1 ) | ||
if ( keysThatFail.indexOf(key) > -1 ) | ||
assert.equal(false, is.not[method](subjects[key], standard), key + ' is expected to fail.') | ||
else | ||
assert.equal(true , is.not[method](subjects[key], standard), key + ' is expected to pass.') | ||
else | ||
assert.equal(false, is.not[method](subjects[key], standard), key + ' is expected to fail.') | ||
}) | ||
@@ -53,0 +53,0 @@ }, |
@@ -42,2 +42,3 @@ function subjects() { | ||
'newRegExp' : new RegExp("^foo"), | ||
'newString' : new String('foo'), | ||
'nil' : null, | ||
@@ -44,0 +45,0 @@ 'objectCreateNull' : Object.create(null), |
@@ -11,2 +11,3 @@ var asserts = require('./_asserts') | ||
'newObject', | ||
'newString', | ||
'emptyObject', | ||
@@ -29,2 +30,3 @@ 'plainObject', | ||
'newObject', | ||
'newString', | ||
'emptyObject', | ||
@@ -31,0 +33,0 @@ 'plainObject', |
@@ -38,2 +38,3 @@ var is = require('../is-too') | ||
'newRegExp', | ||
'newString', | ||
'objectCreateNull', | ||
@@ -40,0 +41,0 @@ 'objectCreateObjectPrototype', |
49067
25
1639