has-properties
Advanced tools
Sorry, the diff of this file is not supported yet
+7
-2
@@ -9,6 +9,11 @@ 'use strict'; | ||
| var isObject = function(obj) { | ||
| return (typeof obj === 'object' && !Array.isArray(obj)); | ||
| }; | ||
| module.exports = function(obj, keys) { | ||
| if (obj !== null && typeof obj !== 'object') { | ||
| if (obj === null || !isObject(obj)) { | ||
| throw new Error('First argument must be an object.'); | ||
| } | ||
| if (!Array.isArray(keys)) { | ||
@@ -18,2 +23,2 @@ throw new Error('Second argument must be an array.'); | ||
| return diff(keys, Object.keys(obj)).length === 0; | ||
| }; | ||
| }; |
+1
-1
| { | ||
| "name": "has-properties", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Checks if the given object has the required/mandatory properties.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
2899
70.43%4
33.33%18
28.57%