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

gulp-rev-all

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-rev-all - npm Package Compare versions

Comparing version 0.8.5 to 0.8.6

2

package.json
{
"name": "gulp-rev-all",
"version": "0.8.5",
"version": "0.8.6",
"description": "Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn.098f6bcd.css, also re-writes references in each file to new reved name.",

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

@@ -165,7 +165,7 @@ # [gulp](https://github.com/wearefractal/gulp)-rev-all [![Build Status](https://travis-ci.org/smysnk/gulp-rev-all.png?branch=master)](https://travis-ci.org/smysnk/gulp-rev-all)

Don't update references in files matching these rules
Don't update references matching these rules
Type: `Array of (Regex and/or String)`
Default: `[]`
#### options.dontSearchReference
#### options.dontSearchFile

@@ -172,0 +172,0 @@ Don't search for references in files matching these rules

@@ -17,3 +17,3 @@ var gracefulfs = require('graceful-fs');

'dontUpdateReference': [],
'dontSearchReference': [],
'dontSearchFile': [],
'fileNameVersion': 'version.json',

@@ -129,3 +129,3 @@ 'fileNameManifest': 'rev-manifest.json',

// Don't try and resolve references in binary files or files that have been blacklisted
if (this.Tool.is_binary_file(fileResolveReferencesIn) || !this.shouldSearchReference(fileResolveReferencesIn)) return;
if (this.Tool.is_binary_file(fileResolveReferencesIn) || !this.shouldSearchFile(fileResolveReferencesIn)) return;

@@ -331,3 +331,3 @@ var referenceGroupRelative = [];

*/
Revisioner.prototype.shouldSearchReference = function (file) {
Revisioner.prototype.shouldSearchFile = function (file) {

@@ -343,4 +343,4 @@ var filename = this.Tool.get_relative_path(file.base, file.path);

for (var i = this.options.dontSearchReference.length; i--;) {
var regex = (this.options.dontSearchReference[i] instanceof RegExp) ? this.options.dontSearchReference[i] : new RegExp(this.options.dontSearchReference[i] + '$', 'ig');
for (var i = this.options.dontSearchFile.length; i--;) {
var regex = (this.options.dontSearchFile[i] instanceof RegExp) ? this.options.dontSearchFile[i] : new RegExp(this.options.dontSearchFile[i] + '$', 'ig');
if (filename.match(regex)) {

@@ -347,0 +347,0 @@ return false;

@@ -312,2 +312,3 @@ var RevAll = require('./index');

String(files['/index.html'].contents).should.not.match(/\.[a-z0-9]{8}\.html/g);
String(files['/index.html'].contents).should.match(/\.[a-z0-9]{8}\.jpg/g);
done();

@@ -331,2 +332,3 @@

String(files['/index.html'].contents).should.not.match(/\.[a-z0-9]{8}\.html/g);
String(files['/index.html'].contents).should.match(/\.[a-z0-9]{8}\.jpg/g);
done();

@@ -342,2 +344,42 @@

describe('dontSearchFile', function () {
it('should not update reference when specified with file extension', function (done) {
setup({
dontSearchFile: ['.html']
});
streamRevision.on('data', function (file) { });
streamRevision.on('end', function () {
String(files['/index.html'].contents).should.not.match(/\.[a-z0-9]{8}\./g);
done();
});
Tool.write_glob_to_stream(base, 'test/fixtures/config1/**', streamRevision);
});
it('should not update reference when specified with file regex', function (done) {
setup({
dontSearchFile: [ /.html$/g ]
});
streamRevision.on('data', function (file) {});
streamRevision.on('end', function () {
String(files['/index.html'].contents).should.not.match(/\.[a-z0-9]{8}\./g);
done();
});
Tool.write_glob_to_stream(base, 'test/fixtures/config1/**', streamRevision);
});
});
});

@@ -344,0 +386,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