postcss-svgo
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -19,6 +19,2 @@ 'use strict'; | ||
var _isSvg = require('is-svg'); | ||
var _isSvg2 = _interopRequireDefault(_isSvg); | ||
var _url = require('./lib/url'); | ||
@@ -32,3 +28,3 @@ | ||
function minifyPromise(decl, getSvgo, opts) { | ||
function minifyPromise(decl, getSvgo, opts, postcssResult) { | ||
const promises = []; | ||
@@ -69,7 +65,7 @@ const parsed = (0, _postcssValueParser2.default)(decl.value); | ||
if (!(0, _isSvg2.default)(svg)) { | ||
return; | ||
} | ||
promises.push(getSvgo().optimize(svg).then(result => { | ||
if (result.error) { | ||
decl.warn(postcssResult, `${result.error}`); | ||
return; | ||
} | ||
let data, optimizedValue; | ||
@@ -98,3 +94,3 @@ | ||
}).catch(error => { | ||
throw new Error(`${PLUGIN}: ${error}`); | ||
decl.warn(postcssResult, `${error}`); | ||
})); | ||
@@ -119,3 +115,3 @@ | ||
return css => { | ||
return (css, result) => { | ||
return new Promise((resolve, reject) => { | ||
@@ -129,3 +125,3 @@ const svgoQueue = []; | ||
svgoQueue.push(minifyPromise(decl, getSvgo, opts)); | ||
svgoQueue.push(minifyPromise(decl, getSvgo, opts, result)); | ||
}); | ||
@@ -132,0 +128,0 @@ |
{ | ||
"name": "postcss-svgo", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Optimise inline SVG with PostCSS.", | ||
@@ -36,3 +36,2 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"is-svg": "^3.0.0", | ||
"postcss": "^7.0.0", | ||
@@ -39,0 +38,0 @@ "postcss-value-parser": "^3.0.0", |
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
3
9578
105
- Removedis-svg@^3.0.0
- Removedhtml-comment-regex@1.1.2(transitive)
- Removedis-svg@3.0.0(transitive)