Socket
Socket
Sign inDemoInstall

enhanced-resolve

Package Overview
Dependencies
2
Maintainers
2
Versions
127
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.9.2 to 5.9.3

11

lib/AliasFieldPlugin.js

@@ -52,5 +52,10 @@ /*

}
const data1 = fieldData[innerRequest];
const data2 = fieldData[innerRequest.replace(/^\.\//, "")];
const data = typeof data1 !== "undefined" ? data1 : data2;
const data = Object.prototype.hasOwnProperty.call(
fieldData,
innerRequest
)
? fieldData[innerRequest]
: innerRequest.startsWith("./")
? fieldData[innerRequest.slice(2)]
: undefined;
if (data === innerRequest) return callback();

@@ -57,0 +62,0 @@ if (data === undefined) return callback();

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

const forEachBail = require("./forEachBail");
const { PathType, getType } = require("./util/path");

@@ -34,2 +35,14 @@ /** @typedef {import("./Resolver")} Resolver */

const target = resolver.ensureHook(this.target);
const getAbsolutePathWithSlashEnding = maybeAbsolutePath => {
const type = getType(maybeAbsolutePath);
if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) {
return resolver.join(maybeAbsolutePath, "_").slice(0, -1);
}
return null;
};
const isSubPath = (path, maybeSubPath) => {
const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath);
if (!absolutePath) return false;
return path.startsWith(absolutePath);
};
resolver

@@ -47,7 +60,5 @@ .getHook(this.source)

(!item.onlyModule &&
innerRequest.startsWith(
request.request
? `${item.name}/`
: resolver.join(item.name, "_").slice(0, -1)
))
(request.request
? innerRequest.startsWith(`${item.name}/`)
: isSubPath(innerRequest, item.name)))
) {

@@ -54,0 +65,0 @@ const remainingRequest = innerRequest.substr(item.name.length);

{
"name": "enhanced-resolve",
"version": "5.9.2",
"version": "5.9.3",
"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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc