Socket
Socket
Sign inDemoInstall

require-in-the-middle

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-in-the-middle - npm Package Compare versions

Comparing version 7.2.0 to 7.2.1

19

index.js

@@ -227,8 +227,17 @@ 'use strict'

// fullModuleName = 'foo/bar'
if (hasWhitelist === true && modules.includes(moduleName) === false) {
if (modules.includes(fullModuleName) === false) return exports // abort if module name isn't on whitelist
let isWhitelistedSubmodule = false
if (hasWhitelist) {
// abort if module name isn't on whitelist
if (!modules.includes(moduleName) && !modules.includes(fullModuleName)) {
return exports
}
// if we get to this point, it means that we're requiring a whitelisted sub-module
moduleName = fullModuleName
} else {
if (modules.includes(fullModuleName) && moduleName !== fullModuleName) {
// if we get to this point, it means that we're requiring a whitelisted sub-module
moduleName = fullModuleName
isWhitelistedSubmodule = true
}
}
if (!isWhitelistedSubmodule) {
// figure out if this is the main module file, or a file inside the module

@@ -235,0 +244,0 @@ let res

{
"name": "require-in-the-middle",
"version": "7.2.0",
"version": "7.2.1",
"description": "Module to hook into the Node.js require function",

@@ -5,0 +5,0 @@ "main": "index.js",

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