fast-sourcemap-concat
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -11,5 +11,7 @@ 'use strict'; | ||
const EOL = require('os').EOL; | ||
const endsWith = require('./endsWith'); | ||
const validator = require('sourcemap-validator'); | ||
const logger = require('heimdalljs-logger')('fast-sourcemap-concat:'); | ||
class SourceMap { | ||
@@ -55,2 +57,3 @@ constructor(opts) { | ||
this._sizes = {}; | ||
this.nextFileSourceNeedsComma = false; | ||
} | ||
@@ -93,4 +96,5 @@ | ||
if (this.content.mappings.length > 0 && !/[;,]$/.test(this.content.mappings)) { | ||
if (this.content.mappings.length > 0 && this.nextFileSourceNeedsComma) { | ||
this.content.mappings += ','; | ||
this.nextFileSourceNeedsComma = false; | ||
} | ||
@@ -183,2 +187,3 @@ | ||
mappings += ';'; | ||
this.nextFileSourceNeedsComma = false; | ||
} | ||
@@ -192,4 +197,3 @@ this.content.mappings = mappings; | ||
let lineCount = countNewLines(source); | ||
mappings += this.encoder.encode({ | ||
const encodedVal = this.encoder.encode({ | ||
generatedColumn: this.column, | ||
@@ -201,2 +205,5 @@ source: this.content.sources.length-1, | ||
mappings += encodedVal; | ||
this.nextFileSourceNeedsComma = !(endsWith(encodedVal, ';') || endsWith(encodedVal, ',')); | ||
if (lineCount === 0) { | ||
@@ -210,2 +217,3 @@ // no newline in the source. Keep outputting one big line. | ||
mappings += ';'; | ||
this.nextFileSourceNeedsComma = false; | ||
this.encoder.adjustLine(lineCount-1); | ||
@@ -218,2 +226,3 @@ } | ||
mappings += 'AACA;'; | ||
this.nextFileSourceNeedsComma = false; | ||
} | ||
@@ -266,2 +275,3 @@ this.linesMapped += lineCount; | ||
this.content.mappings += ';'; | ||
this.nextFileSourceNeedsComma = false; | ||
this.linesMapped++; | ||
@@ -340,2 +350,3 @@ } | ||
mappings += match[1]; | ||
this.nextFileSourceNeedsComma = !(endsWith(match[1], ',') || endsWith(match[1], ';')); | ||
lines = match[1].replace(/,/g, '').length; | ||
@@ -364,3 +375,5 @@ if (lines > 0) { | ||
} | ||
mappings += this.encoder.encode(value); | ||
const encodedVal = this.encoder.encode(value); | ||
mappings += encodedVal; | ||
this.nextFileSourceNeedsComma = !(endsWith(encodedVal, ',') || endsWith(encodedVal, ';')); | ||
} | ||
@@ -379,2 +392,3 @@ | ||
mappings += inputMappings; | ||
this.nextFileSourceNeedsComma = !(endsWith(inputMappings, ',') || endsWith(inputMappings, ';')); | ||
inputMappings = ''; | ||
@@ -395,2 +409,3 @@ this.linesMapped = initialMappedLines + cacheHint.lines; | ||
mappings += match[0]; | ||
this.nextFileSourceNeedsComma = !(endsWith(match[0], ',') || endsWith(match[0], ';')); | ||
inputMappings = inputMappings.slice(match[0].length); | ||
@@ -397,0 +412,0 @@ } |
{ | ||
"name": "fast-sourcemap-concat", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Concatenate files while generating or propagating sourcemaps.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
20180
7
547