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

gulp-concat-sourcemap

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-concat-sourcemap - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

7

index.js

@@ -33,2 +33,9 @@ 'use strict';

if(opts.prefix) {
var p = opts.prefix;
while(p-- > 0) {
rel = rel.substring(rel.indexOf('/') + 1);
}
}
file.contents.toString('utf8').split('\n').forEach(function(line, j){

@@ -35,0 +42,0 @@ sourceNode.add(new SourceNode(j + 1, 0, rel, line + '\n'));

2

package.json
{
"name": "gulp-concat-sourcemap",
"version": "1.1.0",
"version": "1.2.0",
"description": "Concatenate files and generate a source map file",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,2 +26,5 @@ gulp-concat-sourcemap [![Build Status](https://travis-ci.org/mikach/gulp-concat-sourcemap.png?branch=master)](https://travis-ci.org/mikach/gulp-concat-sourcemap)

`options.sourceRoot`
An optional root for all relative URLs in the source map.
An optional root for all relative URLs in the source map.
`options.prefix`
Skip prefix for original filenames that appear in source maps. For example {prefix: 3} will drop 3 directories from file names.

@@ -54,2 +54,41 @@ var expect = require('chai').expect;

});
it('should prefix sourcemap output', function(done) {
var file1 = new File({
base: '/test',
path: 'test/path/file1.js',
contents: new Buffer('console.log(\'Hello\');')
});
var file2 = new File({
base: '/test',
path: 'test/path/file2.js',
contents: new Buffer('console.log(\'World\');')
});
var stream = concat('file.js', {prefix: 2});
var contentFile;
stream.on('data', function(newFile) {
if (!contentFile) { // contentFile
contentFile = newFile;
expect(String(newFile.contents)).to.be.equal(
'console.log(\'Hello\');' +
'\n\nconsole.log(\'World\');\n\n' +
'//# sourceMappingURL=file.js.map'
);
} else { // mapFile
expect(String(newFile.contents)).to.be.equal(
'{\n \"version\": 3,\n \"file\": \"file.js\",' +
'\n \"sources\": [\n \"file1.js\",\n \"file2.js\"\n ]' +
',\n \"names\": [],\n \"mappings\": \"AAAA;;ACAA\"\n}'
);
done();
}
});
stream.write(file1);
stream.write(file2);
stream.end();
});
});
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