gulp-modify
Advanced tools
Comparing version
22
index.js
@@ -1,5 +0,5 @@ | ||
// Generated by CoffeeScript 1.7.1 | ||
// Generated by CoffeeScript 1.9.2 | ||
(function() { | ||
'use strict'; | ||
var PLUGIN_NAME, through; | ||
var PLUGIN_NAME, gutil, through; | ||
@@ -10,2 +10,4 @@ PLUGIN_NAME = 'gulp-modify'; | ||
gutil = require('gutil'); | ||
module.exports = function(options) { | ||
@@ -16,10 +18,18 @@ if (options == null) { | ||
return through.obj(function(file, enc, next) { | ||
var content, fileModifier; | ||
var _error, content, error, fileModifier; | ||
error = null; | ||
if (file.isBuffer()) { | ||
if (fileModifier = options.fileModifier) { | ||
content = fileModifier(file, file.contents.toString('utf8')); | ||
file.contents = new Buffer(content); | ||
try { | ||
content = fileModifier(file, file.contents.toString('utf8')); | ||
file.contents = new Buffer(content); | ||
} catch (_error) { | ||
_error = _error; | ||
error = new gutil.PluginError('Error', _error, { | ||
showStack: true | ||
}); | ||
} | ||
} | ||
} | ||
return next(null, file); | ||
return next(error, file); | ||
}); | ||
@@ -26,0 +36,0 @@ }; |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"license": "MIT", | ||
@@ -30,9 +30,11 @@ "main": "index.js", | ||
"dependencies": { | ||
"through2": "*" | ||
"through2": "*", | ||
"gulp-util": "*" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"expect": "*", | ||
"coffee-script": "*" | ||
"coffee-script": "*", | ||
"gulp": "*", | ||
"gulp-util": "*", | ||
"gulp-bump": "*" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
4644
28.5%9
50%32
45.45%2
100%4
33.33%2
100%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added