Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assert-has-keys

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assert-has-keys - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

11

index.js
'use strict';
var assert = require('assert');
var arrify = require('arrify');
var AssertionError = assert.AssertionError;
module.exports = function assertNoKeys(obj, keys) {
if (!Array.isArray(keys)) {
keys = [keys];
}
module.exports = function (obj, keys) {
arrify(keys).forEach(function (key) {
if (typeof key !== 'string') {
throw new TypeError('assert-has-keys expects keys to be strings');
}
keys.forEach(function (key) {
if (!obj.hasOwnProperty(key)) {

@@ -12,0 +13,0 @@ throw new AssertionError({

{
"name": "assert-has-keys",
"version": "0.1.0",
"version": "1.0.0",
"description": "Assert that an object has specific properties",

@@ -33,3 +33,6 @@ "license": "MIT",

"mocha": "*"
},
"dependencies": {
"arrify": "^1.0.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc