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

enhanced-resolve

Package Overview
Dependencies
Maintainers
4
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enhanced-resolve - npm Package Compare versions

Comparing version 5.17.1 to 5.18.0

41

lib/AliasPlugin.js

@@ -61,2 +61,3 @@ /*

if (!innerRequest) return callback();
forEachBail(

@@ -67,3 +68,4 @@ this.options,

let shouldStop = false;
if (
const matchRequest =
innerRequest === item.name ||

@@ -73,6 +75,8 @@ (!item.onlyModule &&

? innerRequest.startsWith(`${item.name}/`)
: isSubPath(innerRequest, item.name)))
) {
/** @type {string} */
const remainingRequest = innerRequest.slice(item.name.length);
: isSubPath(innerRequest, item.name)));
const splitName = item.name.split("*");
const matchWildcard = !item.onlyModule && splitName.length === 2;
if (matchRequest || matchWildcard) {
/**

@@ -96,8 +100,30 @@ * @param {Alias} alias alias

}
let newRequestStr;
const [prefix, suffix] = splitName;
if (
matchWildcard &&
innerRequest.startsWith(prefix) &&
innerRequest.endsWith(suffix)
) {
const match = innerRequest.slice(
prefix.length,
innerRequest.length - suffix.length
);
newRequestStr = item.alias.toString().replace("*", match);
}
if (
matchRequest &&
innerRequest !== alias &&
!innerRequest.startsWith(alias + "/")
) {
/** @type {string} */
const remainingRequest = innerRequest.slice(item.name.length);
newRequestStr = alias + remainingRequest;
}
if (newRequestStr !== undefined) {
shouldStop = true;
const newRequestStr = alias + remainingRequest;
/** @type {ResolveRequest} */

@@ -129,2 +155,3 @@ const obj = {

};
/**

@@ -143,2 +170,3 @@ * @param {null|Error} [err] error

};
if (Array.isArray(item.alias)) {

@@ -154,2 +182,3 @@ return forEachBail(

}
return callback();

@@ -156,0 +185,0 @@ },

2

package.json
{
"name": "enhanced-resolve",
"version": "5.17.1",
"version": "5.18.0",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Offers a async require.resolve function. It's highly configurable.",

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