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.2.3 to 1.2.4

2

index.js

@@ -51,3 +51,3 @@ 'use strict';

if (opts.sourcesContent) {
sourceNode.setSourceContent(file.relative, file.contents.toString('utf8'));
sourceNode.setSourceContent(rel, file.contents.toString('utf8'));
}

@@ -54,0 +54,0 @@ }

{
"name": "gulp-concat-sourcemap",
"version": "1.2.3",
"version": "1.2.4",
"description": "Concatenate files and generate a source map file",

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

@@ -134,2 +134,50 @@ var expect = require('chai').expect;

});
});
it('should generate source content inline', 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, sourcesContent: true});
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 " +
"\"sourcesContent\": [\n " +
"\"console.log('Hello');\",\n " +
"\"console.log('World');\"\n " +
"]\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