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 5.0.4 to 5.1.0

src/globals.d.ts

7

package.json
{
"name": "postcss-svgo",
"version": "5.0.4",
"version": "5.1.0",
"description": "Optimise inline SVG with PostCSS.",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"LICENSE-MIT",
"src"
"src",
"types"
],

@@ -38,2 +40,3 @@ "keywords": [

"devDependencies": {
"@types/svgo": "^2.6.2",
"postcss": "^8.2.15"

@@ -40,0 +43,0 @@ },

@@ -18,4 +18,4 @@ 'use strict';

* @param {string} input the SVG string
* @param {boolean} encode whether to encode the result
* @return {object} the minification result
* @param {Options} opts
* @return {{result: string, isUriEncoded: boolean}} the minification result
*/

@@ -34,3 +34,3 @@ function minifySVG(input, opts) {

if (isUriEncoded) {
svg = decodedUri;
svg = /** @type {string} */ (decodedUri);
}

@@ -52,5 +52,14 @@

return { result: result.data, isUriEncoded };
return {
result: /** @type {import('svgo').OptimizedSvg}*/ (result).data,
isUriEncoded,
};
}
/**
* @param {import('postcss').Declaration} decl
* @param {Options} opts
* @param {import('postcss').Result} postcssResult
* @return {void}
*/
function minify(decl, opts, postcssResult) {

@@ -67,4 +76,6 @@ const parsed = valueParser(decl.value);

}
let { value, quote } = /** @type {valueParser.StringNode} */ (
node.nodes[0]
);
let { value, quote } = node.nodes[0];
let optimizedValue;

@@ -113,3 +124,8 @@

}
/** @typedef {{encode?: boolean, plugins?: object[]} & import('svgo').OptimizeOptions} Options */
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
* @return {import('postcss').Plugin}
*/
function pluginCreator(opts = {}) {

@@ -116,0 +132,0 @@ return {

'use strict';
/**
* @param {string} data
* @return {string}
*/
function encode(data) {

@@ -3,0 +7,0 @@ return data

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