Socket
Socket
Sign inDemoInstall

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 2.1.0 to 2.1.1

27

lib/applySourceMap.js

@@ -49,2 +49,18 @@ /*

const findM2rMapping = (line, column) => {
const m2rMappings = m2rMappingsByLine[line];
let l = 0;
let r = m2rMappings.length;
while (l < r) {
let m = (l + r) >> 1;
if (m2rMappings[m].generatedColumn <= column) {
l = m + 1;
} else {
r = m;
}
}
if (l === 0) return undefined;
return m2rMappings[l - 1];
};
// Store all source contents

@@ -66,10 +82,5 @@ sourceNode.walkSourceContents(function (source, content) {

) {
let m2rBestFit;
const m2rMappings = m2rMappingsByLine[middleMapping.line];
// Note: if this becomes a performance problem, use binary search
for (let i = 0; i < m2rMappings.length; i++) {
if (m2rMappings[i].generatedColumn <= middleMapping.column) {
m2rBestFit = m2rMappings[i];
}
}
// For minimized sources this is performance-relevant,
// since all mappings are in a single line, use a binary search
let m2rBestFit = findM2rMapping(middleMapping.line, middleMapping.column);
if (m2rBestFit) {

@@ -76,0 +87,0 @@ let allowMiddleName = false;

{
"name": "webpack-sources",
"version": "2.1.0",
"version": "2.1.1",
"description": "Source code handling classes for webpack",

@@ -5,0 +5,0 @@ "main": "./lib/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