🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

gulp-hash

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-hash - npm Package Compare versions

Comparing version

to
3.0.6

.eslintrc

44

index.js
var crypto = require('crypto'),
through2 = require('through2'),
gutil = require('gulp-util'),
assign = require('lodash.assign'),
template = require('lodash.template'),
path = require('path')
Promise = require('es6-promise').Promise;
gutil = require('gulp-util'),
assign = require('lodash.assign'),
template = require('lodash.template'),
path = require('path'),
Promise = require('es6-promise').Promise,
fs = require('fs');

@@ -25,3 +26,3 @@ var exportObj = function(options) {

var fileExt = path.extname(file.relative),
fileName = path.basename(file.relative, fileExt);
fileName = path.basename(file.relative, fileExt);

@@ -73,10 +74,10 @@ var hasher = crypto.createHash(options.algorithm);

if (append && ! origManifestContents[manifestPath]) {
try {
var content = fs.readFileSync(manifestPath, {encoding: 'utf8'});
origManifestContents[manifestPath] = JSON.parse(content);
} catch (e) {
origManifestContents[manifestPath] = {};
}
}
if (append && ! origManifestContents[manifestPath]) {
try {
var content = fs.readFileSync(manifestPath, {encoding: 'utf8'});
origManifestContents[manifestPath] = JSON.parse(content);
} catch (e) {
origManifestContents[manifestPath] = {};
}
}

@@ -95,8 +96,5 @@ return through2.obj(

function(cb) {
var contents = {},
finish;
var finish = function(data) {
origManifestContents[manifestPath] = data;
finish = function(data) {
origManifestContents[manifestPath] = data;
this.push(new gutil.File({

@@ -111,6 +109,6 @@ path: manifestPath,

if (append) {
appendQueue.then(new Promise(function(resolve, reject) {
finish(assign({}, origManifestContents[manifestPath], manifest));
resolve();
}));
appendQueue.then(new Promise(function(resolve) {
finish(assign({}, origManifestContents[manifestPath], manifest));
resolve();
}));
} else {

@@ -117,0 +115,0 @@ finish(manifest);

{
"name": "gulp-hash",
"version": "3.0.5",
"version": "3.0.6",
"description": "Cachebust your assets by adding a hash to the filename",
"license": "MIT",
"keywords": [

@@ -6,0 +7,0 @@ "cache",