magic-string
Advanced tools
Comparing version 0.30.7 to 0.30.8
@@ -325,5 +325,8 @@ 'use strict'; | ||
if (content.length) { | ||
const contentLengthMinusOne = content.length - 1; | ||
let contentLineEnd = content.indexOf('\n', 0); | ||
let previousContentLineEnd = -1; | ||
while (contentLineEnd >= 0) { | ||
// Loop through each line in the content and add a segment, but stop if the last line is empty, | ||
// else code afterwards would fill one line too many | ||
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { | ||
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; | ||
@@ -330,0 +333,0 @@ if (nameIndex >= 0) { |
@@ -415,5 +415,8 @@ (function (global, factory) { | ||
if (content.length) { | ||
const contentLengthMinusOne = content.length - 1; | ||
let contentLineEnd = content.indexOf('\n', 0); | ||
let previousContentLineEnd = -1; | ||
while (contentLineEnd >= 0) { | ||
// Loop through each line in the content and add a segment, but stop if the last line is empty, | ||
// else code afterwards would fill one line too many | ||
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { | ||
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; | ||
@@ -420,0 +423,0 @@ if (nameIndex >= 0) { |
{ | ||
"name": "magic-string", | ||
"version": "0.30.7", | ||
"version": "0.30.8", | ||
"description": "Modify strings, generate sourcemaps", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -202,2 +202,7 @@ # magic-string | ||
### s.reset( start, end ) | ||
Resets the characters from `start` to `end` (of the original string, **not** the generated string). | ||
It can be used to restore previously removed characters and discard unwanted changes. | ||
### s.slice( start, end ) | ||
@@ -204,0 +209,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
449430
4012
305