module-keys
Advanced tools
Comparing version 1.0.5 to 1.0.6
16
index.js
@@ -38,4 +38,4 @@ /** | ||
const { | ||
create, defineProperties, defineProperty, freeze, getOwnPropertyNames, getPrototypeOf, | ||
prototype: ObjectPrototype, | ||
create, defineProperties, defineProperty, freeze, getOwnPropertyNames, | ||
getPrototypeOf, prototype: ObjectPrototype, | ||
} = Object; | ||
@@ -105,2 +105,3 @@ const { apply: fApply, call: fCall } = Function.prototype; | ||
* A set of all public keys. | ||
* | ||
* @type {!WeakSet<!PublicKey>} | ||
@@ -115,2 +116,3 @@ */ | ||
* iff called during the execution of their matching private key. | ||
* | ||
* @type {!function(*):boolean} | ||
@@ -190,3 +192,3 @@ */ | ||
if (typeof mayOpen !== 'function') { | ||
throw new Error(`Expected function not ${ mayOpen }`); | ||
throw new TypeError(`Expected function not ${ mayOpen }`); | ||
} | ||
@@ -218,3 +220,3 @@ // Allocate an opaque token | ||
if (typeof ifFrom !== 'function') { | ||
throw new Error(`Expected function not ${ ifFrom }`); | ||
throw new TypeError(`Expected function not ${ ifFrom }`); | ||
} | ||
@@ -272,3 +274,3 @@ const boxData = boxes.get(box); | ||
// CommonJS specific | ||
const { publicKey: myPublicKey } = makeModuleKeys(); | ||
const { publicKey: myPublicKey } = makeModuleKeys('module-keys'); | ||
@@ -284,4 +286,4 @@ module.exports = freeze(defineProperties( | ||
// The public key for this module. Exported for consistency. | ||
publicKey: myPublicKey, | ||
[publicKeySymbol]: myPublicKey, | ||
publicKey: { value: myPublicKey }, | ||
[publicKeySymbol]: { value: myPublicKey }, | ||
})); | ||
@@ -288,0 +290,0 @@ |
{ | ||
"name": "module-keys", | ||
"description": "Module identity as a basis for privilege separation for ESM & CommonJS modules", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "design-patterns", |
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
54732
962