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 2.2.0 to 3.0.0

2

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -598,3 +598,13 @@ # gulp-inject [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

#### options.empty
Type: `Boolean`
Default: `false`
When `true` all tags without corresponding files will be emptied.
[**Warning** this has the potential issue of emptying more than expected.](https://github.com/klei/gulp-inject/issues/135)
#### options.starttag

@@ -601,0 +611,0 @@

@@ -209,17 +209,19 @@ 'use strict';

contents = contents.replace(
getInjectorTagsRegExp(
opt.tags.start(targetExt, '{{ANY}}', opt.starttag),
opt.tags.end(targetExt, '{{ANY}}', opt.starttag)
),
function injector2 (match, starttag, unused, indent, content, endtag) {
if (matches.indexOf(starttag) > - 1) {
return match;
if (opt.empty) {
contents = contents.replace(
getInjectorTagsRegExp(
opt.tags.start(targetExt, '{{ANY}}', opt.starttag),
opt.tags.end(targetExt, '{{ANY}}', opt.starttag)
),
function injector2 (match, starttag, unused, indent, content, endtag) {
if (matches.indexOf(starttag) > - 1) {
return match;
}
if (opt.removeTags) {
return '';
}
return [starttag].concat(endtag).join(indent);
}
if (opt.removeTags) {
return '';
}
return [starttag].concat(endtag).join(indent);
}
);
);
}

@@ -226,0 +228,0 @@ return new Buffer(contents);

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