module-keys
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -170,3 +170,3 @@ /** | ||
* an approved unboxer. | ||
* @param {function(function():boolean):boolean} mayOpen | ||
* @param {!function(function():boolean):boolean} mayOpen | ||
* receives the public key of the opener. | ||
@@ -196,3 +196,3 @@ * Should return `true` to allow. | ||
* @param {*} box the box to unbox. | ||
* @param {function(function():boolean):boolean} ifFrom | ||
* @param {?function(function():boolean):boolean} ifFrom | ||
* if the box may be opened by this unboxer's owner, | ||
@@ -206,2 +206,5 @@ * then ifFrom receives the publicKey of the box creator. | ||
function unbox(box, ifFrom, fallback) { // eslint-disable-line no-shadow | ||
if (ifFrom == null) { // eslint-disable-line | ||
ifFrom = () => true; | ||
} | ||
if (typeof ifFrom !== 'function') { | ||
@@ -229,3 +232,3 @@ throw new Error(`Expected function not ${ ifFrom }`); | ||
* @param {*} box the box to unbox. | ||
* @param {function(function():boolean):boolean} ifFrom | ||
* @param {?function(function():boolean):boolean} ifFrom | ||
* if the box may be opened by this unboxer's owner, | ||
@@ -232,0 +235,0 @@ * then ifFrom receives the publicKey of the box creator. |
{ | ||
"name": "module-keys", | ||
"description": "Module identity as a basis for privilege separation for ESM & CommonJS modules", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "design-patterns", |
@@ -10,2 +10,3 @@ # Module Keys | ||
[![Coverage Status](https://coveralls.io/repos/github/mikesamuel/module-keys/badge.svg?branch=master)](https://coveralls.io/github/mikesamuel/module-keys?branch=master) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/mikesamuel/module-keys/badge.svg?targetFile=package.json)](https://snyk.io/test/github/mikesamuel/module-keys?targetFile=package.json) | ||
@@ -12,0 +13,0 @@ * [Why Module Keys?](#why-module-keys) |
Sorry, the diff of this file is not supported yet
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
54036
948
251