gulp-svgmin
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -14,3 +14,3 @@ /* jshint node:true */ | ||
if(!(svgo instanceof SVGOptim)) { | ||
if (!(svgo instanceof SVGOptim)) { | ||
svgo = new SVGOptim(svgo); | ||
@@ -23,3 +23,5 @@ } | ||
// Handle any error | ||
if(err) cb(gutil.PluginError('svgmin', err)); | ||
if (err) { | ||
cb(gutil.PluginError('svgmin', err)); | ||
} | ||
@@ -41,7 +43,6 @@ // Use the buffered content | ||
var stream = new Transform({objectMode: true}); | ||
var svgo = new SVGOptim({ plugins: [plugins] }); | ||
stream._transform = function(file, unused, done) { | ||
if(file.isStream()) { | ||
if (file.isStream()) { | ||
file.contents = file.contents.pipe( | ||
@@ -48,0 +49,0 @@ new BufferStreams(minifySVGTransform(svgo))); |
{ | ||
"name": "gulp-svgmin", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Minify SVG files with gulp.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
22
test.js
/* jshint node: true */ | ||
/* global describe, it, before, beforeEach, after, afterEach */ | ||
/* global describe, it */ | ||
@@ -24,3 +24,3 @@ 'use strict'; | ||
var stream = svgmin(); | ||
stream.on('data', function(data) { | ||
@@ -30,3 +30,3 @@ expect(String(data.contents)).to.equal(compressed); | ||
}); | ||
stream.write(new gutil.File({ | ||
@@ -36,3 +36,3 @@ contents: new Buffer(raw) | ||
}); | ||
it('should honor disabling plugins, such as keeping the doctype', function(cb) { | ||
@@ -42,3 +42,3 @@ var stream = svgmin({ | ||
}); | ||
stream.on('data', function(data) { | ||
@@ -48,3 +48,3 @@ expect(String(data.contents)).to.have.string(doctype); | ||
}); | ||
stream.write(new gutil.File({ | ||
@@ -62,3 +62,3 @@ contents: new Buffer(raw) | ||
}); | ||
stream.on('data', function(data) { | ||
@@ -70,3 +70,3 @@ data.contents.pipe(es.wait(function(err, data) { | ||
}); | ||
stream.write(fakeFile); | ||
@@ -76,3 +76,3 @@ fakeFile.contents.write(raw); | ||
}); | ||
it('should honor disabling plugins, such as keeping the doctype', function(cb) { | ||
@@ -85,3 +85,3 @@ var stream = svgmin({ | ||
}); | ||
stream.on('data', function(data) { | ||
@@ -93,3 +93,3 @@ data.contents.pipe(es.wait(function(err, data) { | ||
}); | ||
stream.write(fakeFile); | ||
@@ -96,0 +96,0 @@ fakeFile.contents.write(raw); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8039
9
126