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

gulp-inject

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-inject - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

package.json
{
"name": "gulp-inject",
"version": "1.0.1",
"version": "1.0.2",
"description": "A javascript, stylesheet and webcomponent injection plugin for Gulp, i.e. inject file references into your index.html",

@@ -29,3 +29,3 @@ "keywords": [

"dependencies": {
"gulp-util": "^2.2.0",
"gulp-util": "^3.0.0",
"event-stream": "^3.1.0"

@@ -32,0 +32,0 @@ },

@@ -159,18 +159,25 @@ 'use strict';

}
var tags = {};
var targetExt = extname(target.path);
var filesPerExtension = groupBy(collection, function (file) {
return extname(file.path);
var filesPerTags = groupBy(collection, function (file) {
var ext = extname(file.path);
var startTag = opt.tags.start(targetExt, ext, opt.starttag);
var endTag = opt.tags.end(targetExt, ext, opt.endtag);
var tag = startTag + endTag;
if (!tags[tag]) {
tags[tag] = {start: startTag, end: endTag};
}
return tag;
});
var targetExt = extname(target.path);
var extensions = Object.keys(filesPerExtension);
var startAndEndTags = Object.keys(filesPerTags);
log(cyan(collection.length) + ' files into ' + magenta(target.relative) + '.');
return new Buffer(extensions.reduce(function eachInCollection (contents, ext) {
var startTag = opt.tags.start(targetExt, ext, opt.starttag);
var endTag = opt.tags.end(targetExt, ext, opt.endtag);
var files = filesPerExtension[ext];
return new Buffer(startAndEndTags.reduce(function eachInCollection (contents, tag) {
var files = filesPerTags[tag];
var startTag = tags[tag].start;
var endTag = tags[tag].end;
return contents.replace(

@@ -206,3 +213,3 @@ getInjectorTagsRegExp(startTag, endTag),

filepath = addRootSlash(filepath);
} else {
} else if(!opt.addPrefix) {
filepath = removeRootSlash(filepath);

@@ -209,0 +216,0 @@ }

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