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

fast-sourcemap-concat

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-sourcemap-concat - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

lib/endsWith.js

23

lib/source-map.js

@@ -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 @@ }

2

package.json
{
"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",

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