New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-pseudoconcat-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-pseudoconcat-js - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

10

index.js

@@ -8,3 +8,5 @@ var Buffer = require('buffer').Buffer;

module.exports = function(fileName, opt, remoteFiles) {
var URL_SEPARATOR = '/';
module.exports = function(fileName, opt, remoteFiles) {
remoteFiles = remoteFiles || [];

@@ -49,3 +51,7 @@

var scripts = buffer.map(function(file) {
return '<script src="' + path.relative(opt.webRoot, file.path) + '"></script>';
var scriptPath = path.relative(opt.webRoot, file.path);
if (path.sep !== URL_SEPARATOR) {
scriptPath = scriptPath.split(path.sep).join(URL_SEPARATOR);
}
return '<script src="' + scriptPath + '"></script>';
});

@@ -52,0 +58,0 @@

2

package.json
{
"name": "gulp-pseudoconcat-js",
"version": "1.0.0",
"version": "1.1.0",
"description": "Transform javascript files into <script> includes",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/MilanLempera/gulp-pseudoconcat-js",

@@ -9,5 +9,5 @@ /* jshint node: true */

PassThrough = require('stream').PassThrough,
path = require('path'),
pseudoconcat = require('./index');
describe('gulp-pseudoconcat-js', function() {

@@ -90,3 +90,2 @@ var onDataCalled;

it('should not work in stream mode', function(done) {

@@ -111,2 +110,39 @@ var stream = pseudoconcat('file.js');

});
describe('on windows', function() {
var path_sep_original = path.sep;
before(function(done) {
path.sep = '\\';
done();
});
after(function(done) {
path.sep = path_sep_original;
done();
});
it('convert path to url', function(done) {
var stream = pseudoconcat('file.js');
var fakeFile = new gutil.File({
path: 'src\\frontend\\first.js',
contents: new Buffer('file1-content')
});
stream.on('data', function(newFile) {
onDataCalled = true;
assert.equal('document.write(\'<script src="src/frontend/first.js"></script>\');', newFile.contents.toString());
});
stream.on('end', function() {
assert.ok(onDataCalled, 'on data was called');
done();
});
stream.write(fakeFile);
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