Socket
Socket
Sign inDemoInstall

gulp-rev-append

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-rev-append - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

features/hash-absolute-path.feature

4

features/step_definitions/hash-filename.steps.js

@@ -6,3 +6,3 @@ var chai = require('chai');

var FILE_DECL = /(?:href|src)="(.*)[\?]rev=(.*)[\"]/gi;
var FILE_DECL = /(?:href|src)=['|"]([^\s>"']+?)\?rev=([^\s>"']+?)['|"]/gi;

@@ -21,3 +21,3 @@ module.exports = function() {

path: 'test/fixtures/static/index.html',
contents: new Buffer(this.htmlFileContents)
contents: new Buffer(this.htmlFileContents('index'))
});

@@ -24,0 +24,0 @@ callback();

@@ -5,3 +5,2 @@ 'use strict';

var basePath = path.join(process.cwd(), 'test', 'fixtures', 'static');
var indexPath = [basePath, 'index.html'].join(path.sep);

@@ -13,9 +12,6 @@ var World = function World(callback) {

this.plugin = require('../../');
this.htmlFileContents = '';
(function(world) {
fs.readFile(indexPath, function(err, data) {
world.htmlFileContents = data.toString();
callback();
});
}(this));
this.htmlFileContents = function(filename) {
return fs.readFileSync([basePath, filename + '.html'].join(path.sep));
};
callback();

@@ -22,0 +18,0 @@ };

@@ -9,3 +9,3 @@ var fs = require('fs');

var FILE_DECL = /(?:href|src)="(.*)[\?]rev=(.*)[\"]/gi;
var FILE_DECL = /(?:href|src)=['|"]([^\s>"']+?)\?rev=([^\s>"']+?)['|"]/gi;

@@ -32,3 +32,11 @@ var revPlugin = function revPlugin() {

if(groups && groups.length > 1) {
dependencyPath = path.resolve(path.dirname(file.path), groups[1]);
// are we an "absoulte path"? (e.g. /js/app.js)
var normPath = path.normalize(groups[1]);
if (normPath.indexOf(path.sep) === 0) {
dependencyPath = path.join(file.base, normPath);
}
else {
dependencyPath = path.resolve(path.dirname(file.path), normPath);
}
try {

@@ -35,0 +43,0 @@ data = fs.readFileSync(dependencyPath);

{
"name": "gulp-rev-append",
"version": "0.1.3",
"version": "0.1.4",
"description": "Cache-busting plugin for gulp.",

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

Sorry, the diff of this file is not supported yet

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