webpack-sources
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -163,8 +163,10 @@ /* | ||
str += "A"; | ||
lastWrittenLine = currentLine; | ||
writeValue(sourceIndex - currentSourceIndex); | ||
currentSourceIndex = sourceIndex; | ||
writeValue(originalLine - currentOriginalLine); | ||
currentOriginalLine = originalLine; | ||
str += "A"; | ||
if (sourceIndex >= 0) { | ||
lastWrittenLine = currentLine; | ||
writeValue(sourceIndex - currentSourceIndex); | ||
currentSourceIndex = sourceIndex; | ||
writeValue(originalLine - currentOriginalLine); | ||
currentOriginalLine = originalLine; | ||
str += "A"; | ||
} | ||
return str; | ||
@@ -171,0 +173,0 @@ }; |
@@ -59,3 +59,3 @@ /* | ||
); | ||
this._replacements.push(new Replacement(start, end + 1, newValue, name)); | ||
this._replacements.push(new Replacement(start, end, newValue, name)); | ||
this._isSorted = false; | ||
@@ -72,3 +72,3 @@ } | ||
); | ||
this._replacements.push(new Replacement(pos, pos, newValue, name)); | ||
this._replacements.push(new Replacement(pos, pos - 1, newValue, name)); | ||
this._isSorted = false; | ||
@@ -88,3 +88,3 @@ } | ||
const start = Math.floor(replacement.start); | ||
const end = Math.floor(replacement.end); | ||
const end = Math.floor(replacement.end + 1); | ||
if (pos < start) { | ||
@@ -274,3 +274,3 @@ const offset = start - pos; | ||
let replacementNameIndex = nameIndex; | ||
if (name) { | ||
if (sourceIndex >= 0 && name) { | ||
let globalIndex = nameMapping.get(name); | ||
@@ -319,3 +319,6 @@ if (globalIndex === undefined) { | ||
// Remove replaced content by settings this variable | ||
replacmentEnd = Math.max(replacmentEnd, Math.floor(repls[i].end)); | ||
replacmentEnd = Math.max( | ||
replacmentEnd, | ||
Math.floor(repls[i].end + 1) | ||
); | ||
@@ -465,7 +468,3 @@ // Move to next replacment | ||
for (const repl of this._replacements) { | ||
hash.update(`${repl.start}`); | ||
hash.update(`${repl.end}`); | ||
hash.update(`${repl.content}`); | ||
hash.update(`${repl.insertIndex}`); | ||
hash.update(`${repl.name}`); | ||
hash.update(`${repl.start}${repl.end}${repl.content}${repl.name}`); | ||
} | ||
@@ -472,0 +471,0 @@ } |
{ | ||
"name": "webpack-sources", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Source code handling classes for webpack", | ||
@@ -28,3 +28,4 @@ "main": "./lib/index.js", | ||
"files": [ | ||
"lib/" | ||
"lib/", | ||
"!lib/helpers/__mocks__" | ||
], | ||
@@ -31,0 +32,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83133
2735