Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-sources

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-sources - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

43

lib/applySourceMap.js

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

if(m2rBestFit) {
var allowMiddleName = false;
var middleLine;

@@ -86,3 +87,2 @@ var rightSourceContent;

rightSource &&
m2rBestFit.generatedColumn !== middleMapping.column &&
(middleLine = middleSourceLines[m2rBestFit.generatedLine - 1]) &&

@@ -103,18 +103,27 @@ ((rightSourceContentLines = rightSourceContentsLines[rightSource]) ||

var offset = middleMapping.column - m2rBestFit.generatedColumn;
var middlePart = middleLine.slice(
m2rBestFit.generatedColumn,
middleMapping.column
);
var rightPart = rightLine.slice(
m2rBestFit.originalColumn,
m2rBestFit.originalColumn + offset
);
if(middlePart === rightPart) {
// When original and generated code is equal we assume we have an "identity" mapping
// In this case we can offset the original position
m2rBestFit = Object.assign({}, m2rBestFit, {
originalColumn: m2rBestFit.originalColumn + offset,
generatedColumn: middleMapping.column
});
if(offset > 0) {
var middlePart = middleLine.slice(
m2rBestFit.generatedColumn,
middleMapping.column
);
var rightPart = rightLine.slice(
m2rBestFit.originalColumn,
m2rBestFit.originalColumn + offset
);
if(middlePart === rightPart) {
// When original and generated code is equal we assume we have an "identity" mapping
// In this case we can offset the original position
m2rBestFit = Object.assign({}, m2rBestFit, {
originalColumn: m2rBestFit.originalColumn + offset,
generatedColumn: middleMapping.column
});
}
}
if(!m2rBestFit.name && middleMapping.name) {
allowMiddleName =
rightLine.slice(
m2rBestFit.originalColumn,
m2rBestFit.originalColumn + middleMapping.name.length
) === middleMapping.name;
}
}

@@ -131,3 +140,3 @@ }

chunk,
m2rBestFit.name || middleMapping.name
allowMiddleName ? middleMapping.name : m2rBestFit.name
)

@@ -134,0 +143,0 @@ );

{
"name": "webpack-sources",
"version": "1.4.1",
"version": "1.4.2",
"description": "Source code handling classes for webpack",

@@ -25,3 +25,3 @@ "main": "./lib/index.js",

"coveralls": "^2.11.6",
"eslint": "^3.19.0",
"eslint": "^4.18.2",
"eslint-plugin-nodeca": "^1.0.3",

@@ -28,0 +28,0 @@ "istanbul": "^0.4.1",

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