1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Update minor and patch dependencies (#1528)

* @rollup/plugin-node-resolve  ^11.2.0  →  ^11.2.1
* @types/jest                  ^27.0.0  →  ^27.0.1
* colorette                     ^1.2.2  →   ^1.3.0
* commander                     ^7.1.0  →   ^7.2.0
* css-tree                      ^1.1.2  →   ^1.1.3
* eslint                       ^7.22.0  →  ^7.32.0
* playwright                    ^1.9.2  →  ^1.14.0
* prettier                      ^2.2.1  →   ^2.3.2
* rollup                       ^2.42.1  →  ^2.56.2
* typescript                    ^4.2.3  →   ^4.3.5
This commit is contained in:
XhmikosR
2021-08-15 13:57:58 +03:00
committed by GitHub
parent 9b8f13e911
commit 75ec2943b0
7 changed files with 374 additions and 848 deletions

1178
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -93,31 +93,31 @@
}, },
"dependencies": { "dependencies": {
"@trysound/sax": "0.1.1", "@trysound/sax": "0.1.1",
"colorette": "^1.2.2", "colorette": "^1.3.0",
"commander": "^7.1.0", "commander": "^7.2.0",
"css-select": "^4.1.3", "css-select": "^4.1.3",
"css-tree": "^1.1.2", "css-tree": "^1.1.3",
"csso": "^4.2.0", "csso": "^4.2.0",
"stable": "^0.1.8" "stable": "^0.1.8"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0", "@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.0", "@rollup/plugin-node-resolve": "^11.2.1",
"@types/jest": "^27.0.0", "@types/jest": "^27.0.1",
"del": "^6.0.0", "del": "^6.0.0",
"eslint": "^7.22.0", "eslint": "^7.32.0",
"jest": "^27.0.6", "jest": "^27.0.6",
"mock-stdin": "^1.0.0", "mock-stdin": "^1.0.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"pixelmatch": "^5.2.1", "pixelmatch": "^5.2.1",
"playwright": "^1.9.2", "playwright": "^1.14.0",
"pngjs": "^6.0.0", "pngjs": "^6.0.0",
"prettier": "^2.2.1", "prettier": "^2.3.2",
"rollup": "^2.42.1", "rollup": "^2.56.2",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"tar-stream": "^2.2.0", "tar-stream": "^2.2.0",
"typescript": "^4.2.3" "typescript": "^4.3.5"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=10.13.0"

View File

@ -87,10 +87,9 @@ const applyTransforms = (elem, pathData, params) => {
.trim() .trim()
.replace(regNumericValues, (num) => removeLeadingZero(num * scale)); .replace(regNumericValues, (num) => removeLeadingZero(num * scale));
} else { } else {
elem.attributes[ elem.attributes['stroke-width'] = strokeWidth.replace(
'stroke-width' regNumericValues,
] = strokeWidth.replace(regNumericValues, (num) => (num) => removeLeadingZero(num * scale)
removeLeadingZero(num * scale)
); );
} }

View File

@ -1,7 +1,8 @@
'use strict'; 'use strict';
var regTransformTypes = /matrix|translate|scale|rotate|skewX|skewY/, var regTransformTypes = /matrix|translate|scale|rotate|skewX|skewY/,
regTransformSplit = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, regTransformSplit =
/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,
regNumericValues = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g; regNumericValues = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;
/** /**

View File

@ -27,7 +27,8 @@ exports.description =
* @author Kir Belevich * @author Kir Belevich
*/ */
exports.fn = function (root) { exports.fn = function (root) {
const regEnableBackground = /^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/; const regEnableBackground =
/^new\s0\s0\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)\s([-+]?\d*\.?\d+([eE][-+]?\d+)?)$/;
let hasFilter = false; let hasFilter = false;
const elems = ['svg', 'mask', 'pattern']; const elems = ['svg', 'mask', 'pattern'];
@ -39,9 +40,8 @@ exports.fn = function (root) {
node.attributes.width != null && node.attributes.width != null &&
node.attributes.height != null node.attributes.height != null
) { ) {
const match = node.attributes['enable-background'].match( const match =
regEnableBackground node.attributes['enable-background'].match(regEnableBackground);
);
if (match) { if (match) {
if ( if (

View File

@ -7,7 +7,8 @@ exports.type = 'visitor';
exports.active = false; exports.active = false;
exports.description = 'rounds list of values to the fixed precision'; exports.description = 'rounds list of values to the fixed precision';
const regNumericValues = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/; const regNumericValues =
/^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/;
const regSeparator = /\s+,?\s*|,\s*/; const regSeparator = /\s+,?\s*|,\s*/;
const absoluteLengths = { const absoluteLengths = {
// relative to px // relative to px

View File

@ -8,7 +8,8 @@ exports.active = true;
exports.description = exports.description =
'rounds numeric values to the fixed precision, removes default px units'; 'rounds numeric values to the fixed precision, removes default px units';
const regNumericValues = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/; const regNumericValues =
/^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/;
const absoluteLengths = { const absoluteLengths = {
// relative to px // relative to px
cm: 96 / 2.54, cm: 96 / 2.54,