has-properties
Advanced tools
+2
-4
@@ -11,10 +11,8 @@ 'use strict'; | ||
| if (obj !== null && typeof obj === 'object') { | ||
| console.log("Not an object"); | ||
| throw new Error("First argument must be an object."); | ||
| throw new Error('First argument must be an object.'); | ||
| } | ||
| if (!Array.isArray(keys)) { | ||
| console.log("Not an array"); | ||
| throw new Error("Second argument must be an array.") | ||
| throw new Error('Second argument must be an array.'); | ||
| } | ||
| return diff(keys, Object.keys(obj)).length === 0; | ||
| }; |
+4
-4
| { | ||
| "name": "has-properties", | ||
| "version": "0.1.0", | ||
| "description": "Checks if the given object has the required/mandatory properites.", | ||
| "version": "0.2.0", | ||
| "description": "Checks if the given object has the required/mandatory properties.", | ||
| "license": "MIT", | ||
@@ -33,5 +33,5 @@ "repository": "hemanth/has-properties", | ||
| "devDependencies": { | ||
| "browserify": "^3.0.0", | ||
| "browserify": "^6.3.2", | ||
| "mocha": "*" | ||
| } | ||
| } | ||
| } |
+3
-3
| # has-properties [](https://travis-ci.org/hemanth/has-properties) | ||
| > Checks if the given object has the required/mandatory properites. | ||
| > Checks if the given object has the required/mandatory properties. | ||
@@ -20,3 +20,3 @@ ## Install | ||
| var negitive = { | ||
| var negative = { | ||
| name: 'Kitty', | ||
@@ -30,3 +30,3 @@ age: 24 | ||
| hasProperties(negitive, mandatory) // false | ||
| hasProperties(negative, mandatory) // false | ||
@@ -33,0 +33,0 @@ ``` |
1701
-3.68%14
-12.5%