Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

has-properties

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-properties - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+2
-4
index.js

@@ -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;
};
{
"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": "*"
}
}
}
# has-properties [![Build Status](https://travis-ci.org/hemanth/has-properties.svg?branch=master)](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 @@ ```