Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svgo

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgo - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

9

CHANGELOG.md

@@ -0,1 +1,8 @@

### [ [>](https://github.com/svg/svgo/tree/v0.5.4) ] 0.5.4 / 05.08.2015
* New parameter `useShortTags` by @bradbarrow. Now svgo can produce correct non-selfclosing tags (useful in HTML in old browsers).
* Fixed failing on empty transformation (which could be produced by two opposite).
* Fixed removing paths which have numbers with exponent notation.
* Fixed a bug with arc transformation.
* Some typo fixes.
### [ [>](https://github.com/svg/svgo/tree/v0.5.3) ] 0.5.3 / 21.06.2015

@@ -7,3 +14,3 @@ * Fixed breaking related to rounding functions in “[convertTransform](https://github.com/svg/svgo/blob/master/plugins/convertTransform.js)”.

* New command-line option `--show-plugins` displaying list of plugins.
* Two new optional plugins: “[removeDimensions](removeDimensions.js)” (removes `width` and `height` if there is `viewBox`) and “[removeAttrsPlugin](removeAttrsPlugin.js)” (by @bennyschudel).
* Two new optional plugins: “[removeDimensions](https://github.com/svg/svgo/blob/master/plugins/removeDimensions.js)” (removes `width` and `height` if there is `viewBox`) and “[removeAttrsPlugin](https://github.com/svg/svgo/blob/master/plugins/removeAttrs.js)” (by @bennyschudel).

@@ -10,0 +17,0 @@ ### [ [>](https://github.com/svg/svgo/tree/v0.5.2) ] 0.5.2 / 24.05.2015

26

lib/svgo/js2svg.js

@@ -29,3 +29,4 @@ 'use strict';

encodeEntity: encodeEntity,
pretty: false
pretty: false,
useShortTags: true
};

@@ -232,9 +233,18 @@

if (data.isEmpty()) {
return this.createIndent() +
this.config.tagShortStart +
data.elem +
this.createAttrs(data) +
this.config.tagShortEnd;
if (this.config.useShortTags) {
return this.createIndent() +
this.config.tagShortStart +
data.elem +
this.createAttrs(data) +
this.config.tagShortEnd;
} else {
return this.createIndent() +
this.config.tagShortStart +
data.elem +
this.createAttrs(data) +
this.config.tagOpenEnd +
this.config.tagCloseStart +
data.elem +
this.config.tagCloseEnd;
}
// non-empty element

@@ -241,0 +251,0 @@ } else {

{
"name": "svgo",
"version": "0.5.3",
"version": "0.5.4",
"description": "Nodejs-based tool for optimizing SVG vector graphics files",

@@ -51,6 +51,6 @@ "keywords": [ "svgo", "svg", "optimize", "minify" ],

"mocha": "~2.2.5",
"should": "7.0.1",
"istanbul": "~0.3.15",
"should": "7.0.2",
"istanbul": "~0.3.17",
"mocha-istanbul": "~0.2.0",
"coveralls": "~2.11.2"
"coveralls": "~2.11.3"
},

@@ -57,0 +57,0 @@ "engines": {

@@ -178,3 +178,3 @@ /* global a2c */

// gradiends or clip-path which are also subjects to transform.
if (!elem.hasAttr('transform') ||
if (!elem.hasAttr('transform') || !elem.attr('transform').value ||
elem.someAttr(function(attr) {

@@ -181,0 +181,0 @@ return ~referencesProps.indexOf(attr.name) && ~attr.value.indexOf('url(');

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

sin = Math.sin(rot),
h = Math.pow(arc[5] * cos - arc[6] * sin, 2) / (4 * a * a) +
Math.pow(arc[5] * sin + arc[6] * cos, 2) / (4 * b * b);
h = Math.pow(arc[5] * cos + arc[6] * sin, 2) / (4 * a * a) +
Math.pow(arc[6] * cos - arc[5] * sin, 2) / (4 * b * b);
if (h > 1) {

@@ -251,0 +251,0 @@ h = Math.sqrt(h);

@@ -96,3 +96,7 @@ 'use strict';

item.attr(attrName).value = js2transform(data, params);
if (data.length) {
item.attr(attrName).value = js2transform(data, params);
} else {
item.removeAttr(attrName);
}
}

@@ -99,0 +103,0 @@

@@ -26,3 +26,3 @@ 'use strict';

var regValidPath = /M\s*(?:[+-]?(?:\d*\.\d+|\d+(?!\.\d)\.?)(?!\d)\s*,?\s*){2}\D*\d/i;
var regValidPath = /M\s*(?:[-+]?(?:\d*\.\d+|\d+\.?)([eE][-+]?\d+)?(?![\de.])\s*,?\s*){2}\D*\d/i;

@@ -29,0 +29,0 @@ /**

@@ -9,3 +9,3 @@ 'use strict';

exports.active = false;
exports.active = !false;

@@ -16,4 +16,4 @@ exports.description = 'performs a set of operations on SVG with one path inside (disabled by default)';

// width and height to resize SVG and rescale inner Path
width: false,
height: false,
width: 32,
height: 32,

@@ -301,2 +301,3 @@ // scale inner Path without resizing SVG

if (transform) {
console.log(transform)

@@ -312,2 +313,3 @@ pathElem.addAttr({

console.log(path)
// transformed data rounding

@@ -314,0 +316,0 @@ path.forEach(function(pathItem) {

@@ -36,3 +36,3 @@ **english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md)

* [ [ cleanUpEnableBackground](https://github.com/svg/svgo/blob/master/plugins/cleanupEnableBackground.js) ] remove or cleanup `enable-background` attribute when possible
* [ [ convertTyleToAttrs](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] convert styles into attributes
* [ [ convertStyleToAttrs](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] convert styles into attributes
* [ [ convertColors](https://github.com/svg/svgo/blob/master/plugins/convertColors.js) ] convert colors (from `rgb()` to `#rrggbb`, from `#rrggbb` to `#rgb`)

@@ -39,0 +39,0 @@ * [ [ convertPathData](https://github.com/svg/svgo/blob/master/plugins/convertPathData.js) ] convert Path data to relative or absolute whichever is shorter, convert one segment to another, trim useless delimiters, smart rounding and much more

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