Socket
Socket
Sign inDemoInstall

enhanced-resolve

Package Overview
Dependencies
Maintainers
1
Versions
130
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 3.0.2 to 3.0.3

21

lib/AliasPlugin.js

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

function startsWith(string, searchString) {
var stringLength = string.length;
var searchLength = searchString.length;
// early out if the search length is greater than the search string
if(searchLength > stringLength) {
return false;
}
var index = -1;
while(++index < searchLength) {
if(string.charCodeAt(index) !== searchString.charCodeAt(index)) {
return false;
}
}
return true;
}
function AliasPlugin(source, options, target) {

@@ -27,4 +44,4 @@ this.source = source;

if(!innerRequest) return callback();
if((!onlyModule && innerRequest.indexOf(name + "/") === 0) || innerRequest === name) {
if(innerRequest.indexOf(alias + "/") !== 0 && innerRequest != alias) {
if(innerRequest === name || (!onlyModule && startsWith(innerRequest, name + "/"))) {
if(innerRequest !== alias && !startsWith(innerRequest, alias + "/")) {
var newRequestStr = alias + innerRequest.substr(name.length);

@@ -31,0 +48,0 @@ var obj = assign({}, request, {

2

lib/getPaths.js

@@ -23,3 +23,3 @@ /*

for(var i = parts.length - 2; i > 2; i -= 2) {
var part = parts[i];
part = parts[i];
path = path.substr(0, path.length - part.length) || "/";

@@ -26,0 +26,0 @@ paths.push(path);

@@ -21,3 +21,3 @@ /*

}
if(callback.log) {
if(parsed && callback.log) {
if(parsed.module)

@@ -24,0 +24,0 @@ callback.log("Parsed request is a module");

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

var NodeJsInputFileSystem = require("./NodeJsInputFileSystem");
var SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator");
var CachedInputFileSystem = require("./CachedInputFileSystem");

@@ -37,3 +35,2 @@ var ParsePlugin = require("./ParsePlugin");

var UnsafeCachePlugin = require("./UnsafeCachePlugin");
var LogInfoPlugin = require("./LogInfoPlugin");

@@ -40,0 +37,0 @@ exports.createResolver = function(options) {

{
"name": "enhanced-resolve",
"version": "3.0.2",
"version": "3.0.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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc