Socket
Socket
Sign inDemoInstall

postcss-svgo

Package Overview
Dependencies
Maintainers
7
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-svgo - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

20

dist/index.js

@@ -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 @@

3

package.json
{
"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",

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