Comparing version 2.0.1 to 2.1.0
@@ -28,3 +28,3 @@ (function () { | ||
keys.forEach(function (value) { | ||
state = Object.keys(copy).indexOf(value) !== -1; | ||
state = state && Object.keys(copy).indexOf(value) !== -1; | ||
@@ -31,0 +31,0 @@ if (state) { |
{ | ||
"name": "ifonly", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "ifonly is function that checks if your object have only and only specific properties you passed.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,2 +26,7 @@ var ifonly = require('../index.js'); | ||
it('should return false', function () { | ||
var obj = { a: 'a' }; | ||
ifonly(obj, ['b', 'a']).should.equal(false); | ||
}); | ||
it('should return true and ignore empty strings', function () { | ||
@@ -28,0 +33,0 @@ var obj = { a: '', b: 'b', c: '' }; |
4636
93