From f06956efd2dc4bf77244a9fcce2b883a00b925af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Dec 2023 22:46:53 +0800 Subject: updated node modules --- node_modules/svgo/plugins/convertTransform.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'node_modules/svgo/plugins/convertTransform.js') diff --git a/node_modules/svgo/plugins/convertTransform.js b/node_modules/svgo/plugins/convertTransform.js index d90c3efd..b69e17a3 100644 --- a/node_modules/svgo/plugins/convertTransform.js +++ b/node_modules/svgo/plugins/convertTransform.js @@ -131,7 +131,7 @@ const convertTransform = (item, attrName, params) => { * Defines precision to work with certain parts. * transformPrecision - for scale and four first matrix parameters (needs a better precision due to multiplying), * floatPrecision - for translate including two last matrix and rotate parameters, - * degPrecision - for rotate and skew. By default it's equal to (rougly) + * degPrecision - for rotate and skew. By default it's equal to (roughly) * transformPrecision - 2 or floatPrecision whichever is lower. Can be set in params. * * @type {(data: Array, params: TransformParams) => TransformParams} @@ -294,7 +294,7 @@ const convertToShorts = (transforms, params) => { /** * Remove useless transforms. * - * @type {(trasforms: Array) => Array} + * @type {(transforms: Array) => Array} */ const removeUseless = (transforms) => { return transforms.filter((transform) => { @@ -335,18 +335,12 @@ const removeUseless = (transforms) => { * @type {(transformJS: Array, params: TransformParams) => string} */ const js2transform = (transformJS, params) => { - var transformString = ''; - - // collect output value string - transformJS.forEach((transform) => { - roundTransform(transform, params); - transformString += - (transformString && ' ') + - transform.name + - '(' + - cleanupOutData(transform.data, params) + - ')'; - }); + const transformString = transformJS + .map((transform) => { + roundTransform(transform, params); + return `${transform.name}(${cleanupOutData(transform.data, params)})`; + }) + .join(''); return transformString; }; -- cgit v1.2.3