assert-has-keys
Advanced tools
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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2924
16
1
1
+ Addedarrify@^1.0.0
+ Addedarrify@1.0.1(transitive)