Comparing version 0.6.0 to 0.6.1
@@ -0,1 +1,7 @@ | ||
### [ [>](https://github.com/svg/svgo/tree/v0.6.1) ] 0.6.1 / 21.11.2015 | ||
* Added option `--quite` to suppress output (by @phihag). | ||
* Removed `lib-cov` folder from the package, which was erroneously included before. | ||
* Fixed errors in “[minifyStyles](https://github.com/svg/svgo/blob/master/plugins/minifyStyles.js)” when there are `<style>` elements with `CDATA` content or without content at all. | ||
* Amended transform functions parsing to prevent errors when there are no separators between numbers (which isn't allowed by syntax, but understood by browsers). | ||
### [ [>](https://github.com/svg/svgo/tree/v0.6.0) ] 0.6.0 / 08.11.2015 | ||
@@ -2,0 +8,0 @@ * New optimization: circular curves now being converted to arcs. A notable improvement for circles within paths. |
@@ -107,2 +107,7 @@ /* jshint quotmark: false */ | ||
.opt() | ||
.name('quiet').title('Only output error messages, not regular status messages') | ||
.short('q').long('quiet') | ||
.flag() | ||
.end() | ||
.opt() | ||
.name('show-plugins').title('Show available plugins and exit') | ||
@@ -174,2 +179,7 @@ .long('show-plugins') | ||
// --quiet | ||
if (opts.quiet) { | ||
config.quiet = opts.quiet; | ||
} | ||
// --precision | ||
@@ -262,3 +272,2 @@ if (opts.precision) { | ||
} | ||
}); | ||
@@ -301,5 +310,7 @@ | ||
console.log('\r'); | ||
if (!config.quiet) { | ||
console.log('\r'); | ||
} | ||
saveFileAndPrintInfo(result.data, output, inBytes, outBytes, time); | ||
saveFileAndPrintInfo(config, result.data, output, inBytes, outBytes, time); | ||
@@ -312,5 +323,8 @@ } | ||
function saveFileAndPrintInfo(data, path, inBytes, outBytes, time) { | ||
function saveFileAndPrintInfo(config, data, path, inBytes, outBytes, time) { | ||
FS.writeFile(path, data, 'utf8', function() { | ||
if (config.quiet) { | ||
return; | ||
} | ||
@@ -328,3 +342,2 @@ // print time info | ||
function printTimeInfo(time) { | ||
console.log('Done in ' + time + ' ms!'); | ||
@@ -426,3 +439,5 @@ | ||
console.log('Processing directory \'' + dir + '\':\n'); | ||
if (!config.quiet) { | ||
console.log('Processing directory \'' + dir + '\':\n'); | ||
} | ||
@@ -500,9 +515,11 @@ // absoluted folder path | ||
console.log(file + ':'); | ||
if (!config.quiet) { | ||
console.log(file + ':'); | ||
// print time info | ||
printTimeInfo(time); | ||
// print time info | ||
printTimeInfo(time); | ||
// print optimization profit info | ||
printProfitInfo(inBytes, outBytes); | ||
// print optimization profit info | ||
printProfitInfo(inBytes, outBytes); | ||
} | ||
@@ -509,0 +526,0 @@ //move on to the next file |
{ | ||
"name": "svgo", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Nodejs-based tool for optimizing SVG vector graphics files", | ||
@@ -48,6 +48,6 @@ "keywords": [ "svgo", "svg", "optimize", "minify" ], | ||
"mkdirp": "~0.5.1", | ||
"csso": "~1.4.1" | ||
"csso": "~1.4.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~2.3.3", | ||
"mocha": "~2.3.4", | ||
"should": "7.1.1", | ||
@@ -54,0 +54,0 @@ "istanbul": "~0.4.0", |
@@ -5,3 +5,3 @@ 'use strict'; | ||
regTransformSplit = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, | ||
regTransformDataSplit = /[\s,]+/; | ||
regNumericValues = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g; | ||
@@ -24,2 +24,4 @@ /** | ||
transformString.split(regTransformSplit).forEach(function(item) { | ||
/*jshint -W084 */ | ||
var num; | ||
@@ -34,6 +36,11 @@ if (item) { | ||
// then split it into [10, 50] and collect as context.data | ||
current.data = item.split(regTransformDataSplit).map(Number); | ||
while (num = regNumericValues.exec(item)) { | ||
num = Number(num); | ||
if (current.data) | ||
current.data.push(num); | ||
else | ||
current.data = [num]; | ||
} | ||
} | ||
} | ||
}); | ||
@@ -40,0 +47,0 @@ |
@@ -45,4 +45,4 @@ 'use strict'; | ||
if(item.elem) { | ||
if(item.isElem('style')) { | ||
var styleCss = item.content[0].text; | ||
if(item.isElem('style') && !item.isEmpty()) { | ||
var styleCss = item.content[0].text || item.content[0].cdata || []; | ||
if(styleCss.length > 0) { | ||
@@ -49,0 +49,0 @@ var styleCssMinified = minifyCss(styleCss, svgoOptions); |
@@ -85,2 +85,3 @@ **english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md) | ||
--datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded) | ||
-q, --quiet : Only output error messages, not regular status messages | ||
--pretty : Make SVG pretty printed | ||
@@ -87,0 +88,0 @@ --show-plugins : Show available plugins and exit |
@@ -85,2 +85,3 @@ [english](https://github.com/svg/svgo/blob/master/README.md) | **русский** | ||
--datauri=DATAURI : Результат в виде строки Data URI (base64, URI encoded или unencoded) | ||
-q, --quiet : Подавляет вывод информации, выводятся только сообщения об ошибках | ||
--pretty : Удобочитаемое форматирование SVG | ||
@@ -87,0 +88,0 @@ --show-plugins : Доступные плагины |
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
150
4
0
319008
59
8426
Updatedcsso@~1.4.2