New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

module-keys

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-keys - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

babel/index.js

@@ -141,3 +141,3 @@ /**

if (isCommonJsModule) {
// require('module-keys/cjs').polyfill(module, require, 'path');
// require('module-keys/cjs').polyfill(module, require);
polyfills.push(

@@ -144,0 +144,0 @@ t.expressionStatement(

@@ -36,3 +36,3 @@ /**

const { sep } = require('path');
const { makeModuleKeys, publicKeySymbol } = require('../index.js');
const { makeModuleKeys, publicKeySymbol, keysSymbol } = require('../index.js');

@@ -51,4 +51,9 @@ const sepGlobalPattern = sep === '\\' ? /\\/g : new RegExp(`[${ sep }]`, 'g');

function polyfill(module, require) {
if (apply(hasOwnProperty, require, [ 'keys' ])) {
return;
const hasKeysProp = apply(hasOwnProperty, require, [ 'keys' ]);
if (hasKeysProp) {
const oldKeys = require.keys;
if (oldKeys && typeof oldKeys.publicKey === 'function' &&
typeof oldKeys.isPublicKey === 'function') {
return;
}
}

@@ -62,4 +67,9 @@ let moduleIdentifier = `${ module.filename }`;

}
const keysObj = makeModuleKeys(moduleIdentifier);
require.keys = keysObj;
if (!hasKeysProp) {
require.keys = keysObj;
}
require[keysSymbol] = keysObj;
const { publicKey } = keysObj;

@@ -66,0 +76,0 @@ // Export the public key.

@@ -124,2 +124,7 @@ /**

/**
* Symbol used to attach keys to CommonJS require.
*/
const keysSymbol = Symbol('keys');
/** An opaque token used to represent a boxed value in transit. */

@@ -279,2 +284,3 @@ class Box {

publicKeySymbol: { value: publicKeySymbol, enumerable: true },
keysSymbol: { value: keysSymbol, enumerable: true },

@@ -281,0 +287,0 @@ // The public key for this module. Exported for consistency.

{
"name": "module-keys",
"description": "Module identity as a basis for privilege separation for ESM & CommonJS modules",
"version": "1.0.9",
"version": "1.0.10",
"keywords": [

@@ -6,0 +6,0 @@ "design-patterns",

Sorry, the diff of this file is not supported yet

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