From 21168fadab9b36814bac55e3846ed4154ca4727c Mon Sep 17 00:00:00 2001 From: Kendell R Date: Sat, 6 Jan 2024 07:44:29 -0800 Subject: [PATCH] Merge remote-tracking branch 'upstream/main' into patch-optimize-order --- .eslintrc | 9 +- .github/workflows/main.yml | 3 +- .gitignore | 1 + README.md | 12 +- bin/{svgo => svgo.js} | 6 +- docs/03-plugins/convert-path-data.mdx | 3 + lib/builtin.js | 165 +++--- lib/parser.js | 29 +- lib/path.js | 21 +- lib/path.test.js | 50 +- lib/stringifier.js | 31 +- lib/style.js | 54 +- lib/style.test.js | 114 +++-- lib/svgo-node.js | 35 +- lib/svgo-node.test.js | 105 ++-- lib/svgo.d.ts | 6 +- lib/svgo.js | 15 +- lib/svgo.test.js | 55 +- lib/svgo/coa.js | 28 +- lib/svgo/css-select-adapter.d.ts | 2 +- lib/svgo/css-select-adapter.js | 4 +- lib/svgo/plugins.js | 16 +- lib/svgo/tools.js | 41 +- lib/xast.js | 32 +- lib/xast.test.js | 20 +- package.json | 24 +- plugins/_collections.js | 34 +- plugins/_path.js | 15 +- plugins/_transforms.js | 239 +++++---- plugins/addAttributesToSVGElement.js | 10 +- plugins/addClassesToSVGElement.js | 10 +- plugins/applyTransforms.js | 27 +- plugins/cleanupAttrs.js | 11 +- plugins/cleanupEnableBackground.js | 14 +- plugins/cleanupIds.js | 16 +- plugins/cleanupListOfValues.js | 12 +- plugins/cleanupNumericValues.js | 12 +- plugins/collapseGroups.js | 14 +- plugins/convertColors.js | 23 +- plugins/convertEllipseToCircle.js | 10 +- plugins/convertOneStopGradients.js | 28 +- plugins/convertPathData.js | 200 ++++---- plugins/convertShapeToPath.js | 16 +- plugins/convertStyleToAttrs.js | 12 +- plugins/convertTransform.js | 64 +-- plugins/inlineStyles.js | 38 +- plugins/mergePaths.js | 20 +- plugins/mergeStyles.js | 16 +- plugins/minifyStyles.js | 20 +- plugins/moveElemsAttrsToGroup.js | 15 +- plugins/moveGroupAttrsToElems.js | 15 +- plugins/plugins-types.d.ts | 3 +- plugins/prefixIds.js | 16 +- plugins/preset-default.js | 77 ++- plugins/removeAttributesBySelector.js | 12 +- plugins/removeAttrs.js | 10 +- plugins/removeComments.js | 12 +- plugins/removeDesc.js | 12 +- plugins/removeDimensions.js | 10 +- plugins/removeDoctype.js | 12 +- plugins/removeEditorsNSData.js | 15 +- plugins/removeElementsByAttr.js | 12 +- plugins/removeEmptyAttrs.js | 12 +- plugins/removeEmptyContainers.js | 14 +- plugins/removeEmptyText.js | 12 +- plugins/removeHiddenElems.js | 28 +- plugins/removeMetadata.js | 12 +- plugins/removeNonInheritableGroupAttrs.js | 14 +- plugins/removeOffCanvasPaths.js | 18 +- plugins/removeRasterImages.js | 12 +- plugins/removeScriptElement.js | 14 +- plugins/removeStyleElement.js | 12 +- plugins/removeTitle.js | 12 +- plugins/removeUnknownsAndDefaults.js | 18 +- plugins/removeUnusedNS.js | 10 +- plugins/removeUselessDefs.js | 27 +- plugins/removeUselessStrokeAndFill.js | 18 +- plugins/removeViewBox.js | 10 +- plugins/removeXMLNS.js | 10 +- plugins/removeXMLProcInst.js | 12 +- plugins/removeXlink.js | 14 +- plugins/reusePaths.js | 20 +- plugins/sortAttrs.js | 10 +- plugins/sortDefsChildren.js | 10 +- rollup.config.js | 59 ++- test/browser.js | 8 +- test/cli/cli.test.js | 23 +- test/coa/_index.test.js | 45 +- test/fixtures/config-loader/invalid-array.js | 2 +- test/fixtures/config-loader/invalid-null.js | 2 +- .../fixtures/config-loader/invalid-runtime.js | 3 +- test/fixtures/config-loader/invalid-string.js | 2 +- .../config-loader/module-not-found.js | 4 +- test/fixtures/config-loader/one/two/config.js | 2 +- test/fixtures/config-loader/svgo.config.js | 2 +- test/plugins/_index.test.js | 16 +- test/plugins/_transforms.test.js | 62 +++ ...g => addAttributesToSVGElement.01.svg.txt} | 0 ...g => addAttributesToSVGElement.02.svg.txt} | 0 ...g => addAttributesToSVGElement.03.svg.txt} | 0 ...g => addAttributesToSVGElement.04.svg.txt} | 0 ....svg => addClassesToSVGElement.01.svg.txt} | 0 ....svg => addClassesToSVGElement.02.svg.txt} | 0 ....svg => addClassesToSVGElement.03.svg.txt} | 0 ...upAttrs.01.svg => cleanupAttrs.01.svg.txt} | 0 ...upAttrs.02.svg => cleanupAttrs.02.svg.txt} | 0 ...svg => cleanupEnableBackground.01.svg.txt} | 0 ...svg => cleanupEnableBackground.02.svg.txt} | 0 ...svg => cleanupEnableBackground.03.svg.txt} | 0 ...svg => cleanupEnableBackground.04.svg.txt} | 0 ...svg => cleanupEnableBackground.05.svg.txt} | 0 ...leanupIds.01.svg => cleanupIds.01.svg.txt} | 0 ...leanupIds.02.svg => cleanupIds.02.svg.txt} | 0 ...leanupIds.03.svg => cleanupIds.03.svg.txt} | 0 ...leanupIds.04.svg => cleanupIds.04.svg.txt} | 0 ...leanupIds.05.svg => cleanupIds.05.svg.txt} | 0 ...leanupIds.06.svg => cleanupIds.06.svg.txt} | 0 ...leanupIds.07.svg => cleanupIds.07.svg.txt} | 0 ...leanupIds.08.svg => cleanupIds.08.svg.txt} | 0 ...leanupIds.09.svg => cleanupIds.09.svg.txt} | 0 ...leanupIds.10.svg => cleanupIds.10.svg.txt} | 0 ...leanupIds.11.svg => cleanupIds.11.svg.txt} | 0 ...leanupIds.12.svg => cleanupIds.12.svg.txt} | 0 ...leanupIds.13.svg => cleanupIds.13.svg.txt} | 0 ...leanupIds.14.svg => cleanupIds.14.svg.txt} | 0 ...leanupIds.15.svg => cleanupIds.15.svg.txt} | 0 ...leanupIds.16.svg => cleanupIds.16.svg.txt} | 0 ...leanupIds.17.svg => cleanupIds.17.svg.txt} | 0 ...leanupIds.18.svg => cleanupIds.18.svg.txt} | 0 ...leanupIds.19.svg => cleanupIds.19.svg.txt} | 0 ...leanupIds.20.svg => cleanupIds.20.svg.txt} | 0 ...leanupIds.21.svg => cleanupIds.21.svg.txt} | 0 ...leanupIds.22.svg => cleanupIds.22.svg.txt} | 0 ...leanupIds.23.svg => cleanupIds.23.svg.txt} | 0 ...leanupIds.24.svg => cleanupIds.24.svg.txt} | 0 ...leanupIds.25.svg => cleanupIds.25.svg.txt} | 0 ....01.svg => cleanupListOfValues.01.svg.txt} | 0 ....02.svg => cleanupListOfValues.02.svg.txt} | 0 ....03.svg => cleanupListOfValues.03.svg.txt} | 0 ...01.svg => cleanupNumericValues.01.svg.txt} | 0 ...02.svg => cleanupNumericValues.02.svg.txt} | 0 ...roups.01.svg => collapseGroups.01.svg.txt} | 0 ...roups.02.svg => collapseGroups.02.svg.txt} | 0 ...roups.06.svg => collapseGroups.06.svg.txt} | 0 ...roups.07.svg => collapseGroups.07.svg.txt} | 0 ...roups.08.svg => collapseGroups.08.svg.txt} | 0 ...roups.09.svg => collapseGroups.09.svg.txt} | 0 ...roups.11.svg => collapseGroups.11.svg.txt} | 0 ...roups.12.svg => collapseGroups.12.svg.txt} | 0 ...roups.13.svg => collapseGroups.13.svg.txt} | 0 ...roups.14.svg => collapseGroups.14.svg.txt} | 0 ...roups.15.svg => collapseGroups.15.svg.txt} | 0 ...roups.16.svg => collapseGroups.16.svg.txt} | 0 ...Colors.01.svg => convertColors.01.svg.txt} | 0 ...Colors.02.svg => convertColors.02.svg.txt} | 0 ...Colors.03.svg => convertColors.03.svg.txt} | 0 ...Colors.04.svg => convertColors.04.svg.txt} | 0 ....svg => convertEllipseToCircle.01.svg.txt} | 0 ...svg => convertOneStopGradients.01.svg.txt} | 0 ...svg => convertOneStopGradients.02.svg.txt} | 0 ...svg => convertOneStopGradients.03.svg.txt} | 0 ...Data.01.svg => convertPathData.01.svg.txt} | 0 ...Data.02.svg => convertPathData.02.svg.txt} | 0 ...Data.03.svg => convertPathData.03.svg.txt} | 0 ...Data.04.svg => convertPathData.04.svg.txt} | 0 ...Data.05.svg => convertPathData.05.svg.txt} | 0 ...Data.06.svg => convertPathData.06.svg.txt} | 0 ...Data.07.svg => convertPathData.07.svg.txt} | 0 ...Data.08.svg => convertPathData.08.svg.txt} | 0 ...Data.09.svg => convertPathData.09.svg.txt} | 0 ...Data.10.svg => convertPathData.10.svg.txt} | 0 ...Data.11.svg => convertPathData.11.svg.txt} | 0 ...Data.12.svg => convertPathData.12.svg.txt} | 0 ...Data.13.svg => convertPathData.13.svg.txt} | 0 ...Data.14.svg => convertPathData.14.svg.txt} | 0 ...Data.15.svg => convertPathData.15.svg.txt} | 0 ...Data.16.svg => convertPathData.16.svg.txt} | 2 +- ...Data.17.svg => convertPathData.17.svg.txt} | 0 ...Data.18.svg => convertPathData.18.svg.txt} | 0 ...Data.19.svg => convertPathData.19.svg.txt} | 0 ...Data.20.svg => convertPathData.20.svg.txt} | 0 ...Data.21.svg => convertPathData.21.svg.txt} | 0 ...Data.22.svg => convertPathData.22.svg.txt} | 0 ...Data.23.svg => convertPathData.23.svg.txt} | 0 ...Data.24.svg => convertPathData.24.svg.txt} | 0 ...Data.25.svg => convertPathData.25.svg.txt} | 0 ...Data.26.svg => convertPathData.26.svg.txt} | 0 ...Data.27.svg => convertPathData.27.svg.txt} | 0 ...Data.28.svg => convertPathData.28.svg.txt} | 0 ...Data.29.svg => convertPathData.29.svg.txt} | 0 ...Data.30.svg => convertPathData.30.svg.txt} | 0 ...Data.31.svg => convertPathData.31.svg.txt} | 0 ...Data.32.svg => convertPathData.32.svg.txt} | 0 ...Data.33.svg => convertPathData.33.svg.txt} | 0 ...Data.34.svg => convertPathData.34.svg.txt} | 0 test/plugins/convertPathData.35.svg.txt | 13 + ...h.01.svg => convertShapeToPath.01.svg.txt} | 0 ...h.02.svg => convertShapeToPath.02.svg.txt} | 0 ...h.03.svg => convertShapeToPath.03.svg.txt} | 0 ...h.04.svg => convertShapeToPath.04.svg.txt} | 0 ...h.05.svg => convertShapeToPath.05.svg.txt} | 0 ....01.svg => convertStyleToAttrs.01.svg.txt} | 0 ....02.svg => convertStyleToAttrs.02.svg.txt} | 0 ....03.svg => convertStyleToAttrs.03.svg.txt} | 0 ....04.svg => convertStyleToAttrs.04.svg.txt} | 0 ....05.svg => convertStyleToAttrs.05.svg.txt} | 0 ...orm.01.svg => convertTransform.01.svg.txt} | 0 ...orm.02.svg => convertTransform.02.svg.txt} | 0 ...orm.03.svg => convertTransform.03.svg.txt} | 0 ...orm.04.svg => convertTransform.04.svg.txt} | 0 test/plugins/convertTransform.05.svg.txt | 13 + ...eStyles.01.svg => inlineStyles.01.svg.txt} | 0 ...eStyles.02.svg => inlineStyles.02.svg.txt} | 0 ...eStyles.03.svg => inlineStyles.03.svg.txt} | 0 ...eStyles.04.svg => inlineStyles.04.svg.txt} | 0 ...eStyles.05.svg => inlineStyles.05.svg.txt} | 0 ...eStyles.06.svg => inlineStyles.06.svg.txt} | 0 ...eStyles.07.svg => inlineStyles.07.svg.txt} | 0 ...eStyles.08.svg => inlineStyles.08.svg.txt} | 0 ...eStyles.09.svg => inlineStyles.09.svg.txt} | 0 ...eStyles.10.svg => inlineStyles.10.svg.txt} | 0 ...eStyles.11.svg => inlineStyles.11.svg.txt} | 0 ...eStyles.12.svg => inlineStyles.12.svg.txt} | 0 ...eStyles.13.svg => inlineStyles.13.svg.txt} | 0 ...eStyles.14.svg => inlineStyles.14.svg.txt} | 0 ...eStyles.15.svg => inlineStyles.15.svg.txt} | 0 ...eStyles.16.svg => inlineStyles.16.svg.txt} | 0 ...eStyles.17.svg => inlineStyles.17.svg.txt} | 0 ...eStyles.18.svg => inlineStyles.18.svg.txt} | 0 ...eStyles.19.svg => inlineStyles.19.svg.txt} | 0 ...eStyles.20.svg => inlineStyles.20.svg.txt} | 0 ...eStyles.21.svg => inlineStyles.21.svg.txt} | 0 ...eStyles.22.svg => inlineStyles.22.svg.txt} | 0 ...eStyles.23.svg => inlineStyles.23.svg.txt} | 0 ...eStyles.24.svg => inlineStyles.24.svg.txt} | 0 ...eStyles.25.svg => inlineStyles.25.svg.txt} | 0 ...eStyles.26.svg => inlineStyles.26.svg.txt} | 0 ...eStyles.27.svg => inlineStyles.27.svg.txt} | 0 ...eStyles.28.svg => inlineStyles.28.svg.txt} | 0 ...ergePaths.01.svg => mergePaths.01.svg.txt} | 0 ...ergePaths.02.svg => mergePaths.02.svg.txt} | 0 ...ergePaths.03.svg => mergePaths.03.svg.txt} | 0 ...ergePaths.04.svg => mergePaths.04.svg.txt} | 0 ...ergePaths.05.svg => mergePaths.05.svg.txt} | 0 ...ergePaths.06.svg => mergePaths.06.svg.txt} | 0 ...ergePaths.07.svg => mergePaths.07.svg.txt} | 0 ...geStyles.01.svg => mergeStyles.01.svg.txt} | 0 ...geStyles.02.svg => mergeStyles.02.svg.txt} | 0 ...geStyles.03.svg => mergeStyles.03.svg.txt} | 0 ...geStyles.04.svg => mergeStyles.04.svg.txt} | 0 ...geStyles.05.svg => mergeStyles.05.svg.txt} | 0 ...geStyles.06.svg => mergeStyles.06.svg.txt} | 0 ...geStyles.07.svg => mergeStyles.07.svg.txt} | 0 ...geStyles.08.svg => mergeStyles.08.svg.txt} | 0 ...geStyles.09.svg => mergeStyles.09.svg.txt} | 0 ...geStyles.10.svg => mergeStyles.10.svg.txt} | 0 ...geStyles.11.svg => mergeStyles.11.svg.txt} | 0 ...geStyles.12.svg => mergeStyles.12.svg.txt} | 0 ...yStyles.01.svg => minifyStyles.01.svg.txt} | 0 ...yStyles.02.svg => minifyStyles.02.svg.txt} | 0 ...yStyles.03.svg => minifyStyles.03.svg.txt} | 0 ...yStyles.04.svg => minifyStyles.04.svg.txt} | 0 ...yStyles.05.svg => minifyStyles.05.svg.txt} | 0 ...yStyles.06.svg => minifyStyles.06.svg.txt} | 0 ...yStyles.07.svg => minifyStyles.07.svg.txt} | 0 ...yStyles.08.svg => minifyStyles.08.svg.txt} | 0 ...yStyles.09.svg => minifyStyles.09.svg.txt} | 0 ...yStyles.10.svg => minifyStyles.10.svg.txt} | 0 ...yStyles.11.svg => minifyStyles.11.svg.txt} | 0 ...1.svg => moveElemsAttrsToGroup.01.svg.txt} | 0 ...2.svg => moveElemsAttrsToGroup.02.svg.txt} | 0 ...3.svg => moveElemsAttrsToGroup.03.svg.txt} | 0 ...4.svg => moveElemsAttrsToGroup.04.svg.txt} | 0 ...6.svg => moveElemsAttrsToGroup.06.svg.txt} | 0 ...7.svg => moveElemsAttrsToGroup.07.svg.txt} | 0 ...1.svg => moveGroupAttrsToElems.01.svg.txt} | 0 ...2.svg => moveGroupAttrsToElems.02.svg.txt} | 0 ...3.svg => moveGroupAttrsToElems.03.svg.txt} | 0 ...4.svg => moveGroupAttrsToElems.04.svg.txt} | 0 ...5.svg => moveGroupAttrsToElems.05.svg.txt} | 0 ...6.svg => moveGroupAttrsToElems.06.svg.txt} | 0 ...{prefixIds.01.svg => prefixIds.01.svg.txt} | 6 +- ...{prefixIds.02.svg => prefixIds.02.svg.txt} | 4 +- ...{prefixIds.03.svg => prefixIds.03.svg.txt} | 2 +- ...{prefixIds.04.svg => prefixIds.04.svg.txt} | 2 +- ...{prefixIds.05.svg => prefixIds.05.svg.txt} | 12 +- ...{prefixIds.06.svg => prefixIds.06.svg.txt} | 10 +- ...{prefixIds.07.svg => prefixIds.07.svg.txt} | 4 +- ...{prefixIds.08.svg => prefixIds.08.svg.txt} | 4 +- ...{prefixIds.09.svg => prefixIds.09.svg.txt} | 0 ...{prefixIds.10.svg => prefixIds.10.svg.txt} | 6 +- ...{prefixIds.11.svg => prefixIds.11.svg.txt} | 6 +- ...{prefixIds.12.svg => prefixIds.12.svg.txt} | 2 +- test/plugins/prefixIds.test.js | 10 +- ... => removeAttributesBySelector.01.svg.txt} | 0 ... => removeAttributesBySelector.02.svg.txt} | 0 ... => removeAttributesBySelector.03.svg.txt} | 0 ...oveAttrs.01.svg => removeAttrs.01.svg.txt} | 0 ...oveAttrs.02.svg => removeAttrs.02.svg.txt} | 0 ...oveAttrs.03.svg => removeAttrs.03.svg.txt} | 0 ...oveAttrs.04.svg => removeAttrs.04.svg.txt} | 0 ...oveAttrs.05.svg => removeAttrs.05.svg.txt} | 0 ...oveAttrs.06.svg => removeAttrs.06.svg.txt} | 0 ...ments.01.svg => removeComments.01.svg.txt} | 0 ...ments.02.svg => removeComments.02.svg.txt} | 0 ...ments.03.svg => removeComments.03.svg.txt} | 0 ...emoveDesc.01.svg => removeDesc.01.svg.txt} | 0 ...ons.01.svg => removeDimensions.01.svg.txt} | 0 ...ons.02.svg => removeDimensions.02.svg.txt} | 0 ...ons.03.svg => removeDimensions.03.svg.txt} | 0 ...ons.04.svg => removeDimensions.04.svg.txt} | 0 ...ons.05.svg => removeDimensions.05.svg.txt} | 0 ...octype.01.svg => removeDoctype.01.svg.txt} | 0 ....01.svg => removeEditorsNSData.01.svg.txt} | 0 ....02.svg => removeEditorsNSData.02.svg.txt} | 0 ...01.svg => removeElementsByAttr.01.svg.txt} | 0 ...02.svg => removeElementsByAttr.02.svg.txt} | 0 ...03.svg => removeElementsByAttr.03.svg.txt} | 0 ...04.svg => removeElementsByAttr.04.svg.txt} | 0 ...05.svg => removeElementsByAttr.05.svg.txt} | 0 ...06.svg => removeElementsByAttr.06.svg.txt} | 0 ...07.svg => removeElementsByAttr.07.svg.txt} | 0 ...trs.01.svg => removeEmptyAttrs.01.svg.txt} | 0 ...trs.02.svg => removeEmptyAttrs.02.svg.txt} | 0 ...1.svg => removeEmptyContainers.01.svg.txt} | 0 ...2.svg => removeEmptyContainers.02.svg.txt} | 0 ...3.svg => removeEmptyContainers.03.svg.txt} | 0 ...4.svg => removeEmptyContainers.04.svg.txt} | 0 ...5.svg => removeEmptyContainers.05.svg.txt} | 0 ...6.svg => removeEmptyContainers.06.svg.txt} | 0 ...Text.01.svg => removeEmptyText.01.svg.txt} | 0 ...Text.02.svg => removeEmptyText.02.svg.txt} | 0 ...Text.03.svg => removeEmptyText.03.svg.txt} | 0 ...ms.01.svg => removeHiddenElems.01.svg.txt} | 0 ...ms.02.svg => removeHiddenElems.02.svg.txt} | 0 ...ms.03.svg => removeHiddenElems.03.svg.txt} | 0 ...ms.04.svg => removeHiddenElems.04.svg.txt} | 0 ...ms.05.svg => removeHiddenElems.05.svg.txt} | 0 ...ms.06.svg => removeHiddenElems.06.svg.txt} | 0 ...ms.07.svg => removeHiddenElems.07.svg.txt} | 0 ...ms.08.svg => removeHiddenElems.08.svg.txt} | 0 ...ms.09.svg => removeHiddenElems.09.svg.txt} | 0 ...ms.10.svg => removeHiddenElems.10.svg.txt} | 0 ...ms.11.svg => removeHiddenElems.11.svg.txt} | 0 ...ms.12.svg => removeHiddenElems.12.svg.txt} | 0 ...ms.13.svg => removeHiddenElems.13.svg.txt} | 0 ...ms.14.svg => removeHiddenElems.14.svg.txt} | 0 ...ms.15.svg => removeHiddenElems.15.svg.txt} | 0 ...adata.01.svg => removeMetadata.01.svg.txt} | 0 ...removeNonInheritableGroupAttrs.01.svg.txt} | 0 ...removeNonInheritableGroupAttrs.02.svg.txt} | 0 ...01.svg => removeOffCanvasPaths.01.svg.txt} | 0 ...02.svg => removeOffCanvasPaths.02.svg.txt} | 0 ...03.svg => removeOffCanvasPaths.03.svg.txt} | 0 ...04.svg => removeOffCanvasPaths.04.svg.txt} | 0 ...05.svg => removeOffCanvasPaths.05.svg.txt} | 0 ...06.svg => removeOffCanvasPaths.06.svg.txt} | 0 ...s.01.svg => removeRasterImages.01.svg.txt} | 0 ...s.02.svg => removeRasterImages.02.svg.txt} | 0 ....01.svg => removeScriptElement.01.svg.txt} | 0 ....02.svg => removeScriptElement.02.svg.txt} | 0 ....03.svg => removeScriptElement.03.svg.txt} | 0 ....04.svg => removeScriptElement.04.svg.txt} | 0 ....05.svg => removeScriptElement.05.svg.txt} | 0 ...t.01.svg => removeStyleElement.01.svg.txt} | 0 ...oveTitle.01.svg => removeTitle.01.svg.txt} | 0 ...g => removeUnknownsAndDefaults.01.svg.txt} | 0 ...g => removeUnknownsAndDefaults.02.svg.txt} | 0 ...g => removeUnknownsAndDefaults.03.svg.txt} | 0 ...g => removeUnknownsAndDefaults.04.svg.txt} | 0 ...g => removeUnknownsAndDefaults.05.svg.txt} | 0 ...g => removeUnknownsAndDefaults.06.svg.txt} | 0 ...g => removeUnknownsAndDefaults.07.svg.txt} | 0 ...g => removeUnknownsAndDefaults.08.svg.txt} | 0 ...g => removeUnknownsAndDefaults.09.svg.txt} | 0 ...g => removeUnknownsAndDefaults.10.svg.txt} | 0 ...g => removeUnknownsAndDefaults.11.svg.txt} | 0 ...g => removeUnknownsAndDefaults.12.svg.txt} | 0 ...g => removeUnknownsAndDefaults.13.svg.txt} | 0 ...g => removeUnknownsAndDefaults.14.svg.txt} | 0 ...g => removeUnknownsAndDefaults.15.svg.txt} | 0 ...g => removeUnknownsAndDefaults.16.svg.txt} | 0 ...sedNS.01.svg => removeUnusedNS.01.svg.txt} | 0 ...sedNS.02.svg => removeUnusedNS.02.svg.txt} | 0 ...sedNS.03.svg => removeUnusedNS.03.svg.txt} | 0 ...sedNS.04.svg => removeUnusedNS.04.svg.txt} | 0 ...sedNS.05.svg => removeUnusedNS.05.svg.txt} | 0 ...sedNS.06.svg => removeUnusedNS.06.svg.txt} | 0 ...sedNS.07.svg => removeUnusedNS.07.svg.txt} | 0 ...fs.01.svg => removeUselessDefs.01.svg.txt} | 0 ...fs.02.svg => removeUselessDefs.02.svg.txt} | 0 ...fs.03.svg => removeUselessDefs.03.svg.txt} | 0 test/plugins/removeUselessDefs.04.svg.txt | 23 + test/plugins/removeUselessDefs.05.svg.txt | 23 + ... => removeUselessStrokeAndFill.01.svg.txt} | 0 ... => removeUselessStrokeAndFill.02.svg.txt} | 0 ... => removeUselessStrokeAndFill.03.svg.txt} | 0 ... => removeUselessStrokeAndFill.04.svg.txt} | 0 ... => removeUselessStrokeAndFill.05.svg.txt} | 0 ...iewBox.01.svg => removeViewBox.01.svg.txt} | 0 ...iewBox.02.svg => removeViewBox.02.svg.txt} | 0 ...iewBox.03.svg => removeViewBox.03.svg.txt} | 0 ...iewBox.04.svg => removeViewBox.04.svg.txt} | 0 ...iewBox.05.svg => removeViewBox.05.svg.txt} | 0 ...oveXMLNS.01.svg => removeXMLNS.01.svg.txt} | 0 ...st.01.svg => removeXMLProcInst.01.svg.txt} | 0 ...st.02.svg => removeXMLProcInst.02.svg.txt} | 0 ...oveXlink.01.svg => removeXlink.01.svg.txt} | 0 ...oveXlink.02.svg => removeXlink.02.svg.txt} | 0 ...oveXlink.03.svg => removeXlink.03.svg.txt} | 0 ...oveXlink.04.svg => removeXlink.04.svg.txt} | 0 ...eusePaths.01.svg => reusePaths.01.svg.txt} | 0 ...eusePaths.02.svg => reusePaths.02.svg.txt} | 0 ...eusePaths.03.svg => reusePaths.03.svg.txt} | 0 ...eusePaths.04.svg => reusePaths.04.svg.txt} | 0 ...eusePaths.05.svg => reusePaths.05.svg.txt} | 0 ...eusePaths.06.svg => reusePaths.06.svg.txt} | 0 ...{sortAttrs.01.svg => sortAttrs.01.svg.txt} | 0 ...{sortAttrs.02.svg => sortAttrs.02.svg.txt} | 0 ...{sortAttrs.03.svg => sortAttrs.03.svg.txt} | 0 ...{sortAttrs.04.svg => sortAttrs.04.svg.txt} | 0 ...ren.01.svg => sortDefsChildren.01.svg.txt} | 0 test/regression-extract.js | 17 +- test/regression.js | 21 +- test/svg2js/_index.test.js | 23 +- test/svgo.cjs | 33 ++ test/svgo/_index.test.js | 29 +- tsconfig.json | 2 +- yarn.lock | 472 ++++++++++++------ 429 files changed, 1746 insertions(+), 1505 deletions(-) rename bin/{svgo => svgo.js} (55%) create mode 100644 test/plugins/_transforms.test.js rename test/plugins/{addAttributesToSVGElement.01.svg => addAttributesToSVGElement.01.svg.txt} (100%) rename test/plugins/{addAttributesToSVGElement.02.svg => addAttributesToSVGElement.02.svg.txt} (100%) rename test/plugins/{addAttributesToSVGElement.03.svg => addAttributesToSVGElement.03.svg.txt} (100%) rename test/plugins/{addAttributesToSVGElement.04.svg => addAttributesToSVGElement.04.svg.txt} (100%) rename test/plugins/{addClassesToSVGElement.01.svg => addClassesToSVGElement.01.svg.txt} (100%) rename test/plugins/{addClassesToSVGElement.02.svg => addClassesToSVGElement.02.svg.txt} (100%) rename test/plugins/{addClassesToSVGElement.03.svg => addClassesToSVGElement.03.svg.txt} (100%) rename test/plugins/{cleanupAttrs.01.svg => cleanupAttrs.01.svg.txt} (100%) rename test/plugins/{cleanupAttrs.02.svg => cleanupAttrs.02.svg.txt} (100%) rename test/plugins/{cleanupEnableBackground.01.svg => cleanupEnableBackground.01.svg.txt} (100%) rename test/plugins/{cleanupEnableBackground.02.svg => cleanupEnableBackground.02.svg.txt} (100%) rename test/plugins/{cleanupEnableBackground.03.svg => cleanupEnableBackground.03.svg.txt} (100%) rename test/plugins/{cleanupEnableBackground.04.svg => cleanupEnableBackground.04.svg.txt} (100%) rename test/plugins/{cleanupEnableBackground.05.svg => cleanupEnableBackground.05.svg.txt} (100%) rename test/plugins/{cleanupIds.01.svg => cleanupIds.01.svg.txt} (100%) rename test/plugins/{cleanupIds.02.svg => cleanupIds.02.svg.txt} (100%) rename test/plugins/{cleanupIds.03.svg => cleanupIds.03.svg.txt} (100%) rename test/plugins/{cleanupIds.04.svg => cleanupIds.04.svg.txt} (100%) rename test/plugins/{cleanupIds.05.svg => cleanupIds.05.svg.txt} (100%) rename test/plugins/{cleanupIds.06.svg => cleanupIds.06.svg.txt} (100%) rename test/plugins/{cleanupIds.07.svg => cleanupIds.07.svg.txt} (100%) rename test/plugins/{cleanupIds.08.svg => cleanupIds.08.svg.txt} (100%) rename test/plugins/{cleanupIds.09.svg => cleanupIds.09.svg.txt} (100%) rename test/plugins/{cleanupIds.10.svg => cleanupIds.10.svg.txt} (100%) rename test/plugins/{cleanupIds.11.svg => cleanupIds.11.svg.txt} (100%) rename test/plugins/{cleanupIds.12.svg => cleanupIds.12.svg.txt} (100%) rename test/plugins/{cleanupIds.13.svg => cleanupIds.13.svg.txt} (100%) rename test/plugins/{cleanupIds.14.svg => cleanupIds.14.svg.txt} (100%) rename test/plugins/{cleanupIds.15.svg => cleanupIds.15.svg.txt} (100%) rename test/plugins/{cleanupIds.16.svg => cleanupIds.16.svg.txt} (100%) rename test/plugins/{cleanupIds.17.svg => cleanupIds.17.svg.txt} (100%) rename test/plugins/{cleanupIds.18.svg => cleanupIds.18.svg.txt} (100%) rename test/plugins/{cleanupIds.19.svg => cleanupIds.19.svg.txt} (100%) rename test/plugins/{cleanupIds.20.svg => cleanupIds.20.svg.txt} (100%) rename test/plugins/{cleanupIds.21.svg => cleanupIds.21.svg.txt} (100%) rename test/plugins/{cleanupIds.22.svg => cleanupIds.22.svg.txt} (100%) rename test/plugins/{cleanupIds.23.svg => cleanupIds.23.svg.txt} (100%) rename test/plugins/{cleanupIds.24.svg => cleanupIds.24.svg.txt} (100%) rename test/plugins/{cleanupIds.25.svg => cleanupIds.25.svg.txt} (100%) rename test/plugins/{cleanupListOfValues.01.svg => cleanupListOfValues.01.svg.txt} (100%) rename test/plugins/{cleanupListOfValues.02.svg => cleanupListOfValues.02.svg.txt} (100%) rename test/plugins/{cleanupListOfValues.03.svg => cleanupListOfValues.03.svg.txt} (100%) rename test/plugins/{cleanupNumericValues.01.svg => cleanupNumericValues.01.svg.txt} (100%) rename test/plugins/{cleanupNumericValues.02.svg => cleanupNumericValues.02.svg.txt} (100%) rename test/plugins/{collapseGroups.01.svg => collapseGroups.01.svg.txt} (100%) rename test/plugins/{collapseGroups.02.svg => collapseGroups.02.svg.txt} (100%) rename test/plugins/{collapseGroups.06.svg => collapseGroups.06.svg.txt} (100%) rename test/plugins/{collapseGroups.07.svg => collapseGroups.07.svg.txt} (100%) rename test/plugins/{collapseGroups.08.svg => collapseGroups.08.svg.txt} (100%) rename test/plugins/{collapseGroups.09.svg => collapseGroups.09.svg.txt} (100%) rename test/plugins/{collapseGroups.11.svg => collapseGroups.11.svg.txt} (100%) rename test/plugins/{collapseGroups.12.svg => collapseGroups.12.svg.txt} (100%) rename test/plugins/{collapseGroups.13.svg => collapseGroups.13.svg.txt} (100%) rename test/plugins/{collapseGroups.14.svg => collapseGroups.14.svg.txt} (100%) rename test/plugins/{collapseGroups.15.svg => collapseGroups.15.svg.txt} (100%) rename test/plugins/{collapseGroups.16.svg => collapseGroups.16.svg.txt} (100%) rename test/plugins/{convertColors.01.svg => convertColors.01.svg.txt} (100%) rename test/plugins/{convertColors.02.svg => convertColors.02.svg.txt} (100%) rename test/plugins/{convertColors.03.svg => convertColors.03.svg.txt} (100%) rename test/plugins/{convertColors.04.svg => convertColors.04.svg.txt} (100%) rename test/plugins/{convertEllipseToCircle.01.svg => convertEllipseToCircle.01.svg.txt} (100%) rename test/plugins/{convertOneStopGradients.01.svg => convertOneStopGradients.01.svg.txt} (100%) rename test/plugins/{convertOneStopGradients.02.svg => convertOneStopGradients.02.svg.txt} (100%) rename test/plugins/{convertOneStopGradients.03.svg => convertOneStopGradients.03.svg.txt} (100%) rename test/plugins/{convertPathData.01.svg => convertPathData.01.svg.txt} (100%) rename test/plugins/{convertPathData.02.svg => convertPathData.02.svg.txt} (100%) rename test/plugins/{convertPathData.03.svg => convertPathData.03.svg.txt} (100%) rename test/plugins/{convertPathData.04.svg => convertPathData.04.svg.txt} (100%) rename test/plugins/{convertPathData.05.svg => convertPathData.05.svg.txt} (100%) rename test/plugins/{convertPathData.06.svg => convertPathData.06.svg.txt} (100%) rename test/plugins/{convertPathData.07.svg => convertPathData.07.svg.txt} (100%) rename test/plugins/{convertPathData.08.svg => convertPathData.08.svg.txt} (100%) rename test/plugins/{convertPathData.09.svg => convertPathData.09.svg.txt} (100%) rename test/plugins/{convertPathData.10.svg => convertPathData.10.svg.txt} (100%) rename test/plugins/{convertPathData.11.svg => convertPathData.11.svg.txt} (100%) rename test/plugins/{convertPathData.12.svg => convertPathData.12.svg.txt} (100%) rename test/plugins/{convertPathData.13.svg => convertPathData.13.svg.txt} (100%) rename test/plugins/{convertPathData.14.svg => convertPathData.14.svg.txt} (100%) rename test/plugins/{convertPathData.15.svg => convertPathData.15.svg.txt} (100%) rename test/plugins/{convertPathData.16.svg => convertPathData.16.svg.txt} (89%) rename test/plugins/{convertPathData.17.svg => convertPathData.17.svg.txt} (100%) rename test/plugins/{convertPathData.18.svg => convertPathData.18.svg.txt} (100%) rename test/plugins/{convertPathData.19.svg => convertPathData.19.svg.txt} (100%) rename test/plugins/{convertPathData.20.svg => convertPathData.20.svg.txt} (100%) rename test/plugins/{convertPathData.21.svg => convertPathData.21.svg.txt} (100%) rename test/plugins/{convertPathData.22.svg => convertPathData.22.svg.txt} (100%) rename test/plugins/{convertPathData.23.svg => convertPathData.23.svg.txt} (100%) rename test/plugins/{convertPathData.24.svg => convertPathData.24.svg.txt} (100%) rename test/plugins/{convertPathData.25.svg => convertPathData.25.svg.txt} (100%) rename test/plugins/{convertPathData.26.svg => convertPathData.26.svg.txt} (100%) rename test/plugins/{convertPathData.27.svg => convertPathData.27.svg.txt} (100%) rename test/plugins/{convertPathData.28.svg => convertPathData.28.svg.txt} (100%) rename test/plugins/{convertPathData.29.svg => convertPathData.29.svg.txt} (100%) rename test/plugins/{convertPathData.30.svg => convertPathData.30.svg.txt} (100%) rename test/plugins/{convertPathData.31.svg => convertPathData.31.svg.txt} (100%) rename test/plugins/{convertPathData.32.svg => convertPathData.32.svg.txt} (100%) rename test/plugins/{convertPathData.33.svg => convertPathData.33.svg.txt} (100%) rename test/plugins/{convertPathData.34.svg => convertPathData.34.svg.txt} (100%) create mode 100644 test/plugins/convertPathData.35.svg.txt rename test/plugins/{convertShapeToPath.01.svg => convertShapeToPath.01.svg.txt} (100%) rename test/plugins/{convertShapeToPath.02.svg => convertShapeToPath.02.svg.txt} (100%) rename test/plugins/{convertShapeToPath.03.svg => convertShapeToPath.03.svg.txt} (100%) rename test/plugins/{convertShapeToPath.04.svg => convertShapeToPath.04.svg.txt} (100%) rename test/plugins/{convertShapeToPath.05.svg => convertShapeToPath.05.svg.txt} (100%) rename test/plugins/{convertStyleToAttrs.01.svg => convertStyleToAttrs.01.svg.txt} (100%) rename test/plugins/{convertStyleToAttrs.02.svg => convertStyleToAttrs.02.svg.txt} (100%) rename test/plugins/{convertStyleToAttrs.03.svg => convertStyleToAttrs.03.svg.txt} (100%) rename test/plugins/{convertStyleToAttrs.04.svg => convertStyleToAttrs.04.svg.txt} (100%) rename test/plugins/{convertStyleToAttrs.05.svg => convertStyleToAttrs.05.svg.txt} (100%) rename test/plugins/{convertTransform.01.svg => convertTransform.01.svg.txt} (100%) rename test/plugins/{convertTransform.02.svg => convertTransform.02.svg.txt} (100%) rename test/plugins/{convertTransform.03.svg => convertTransform.03.svg.txt} (100%) rename test/plugins/{convertTransform.04.svg => convertTransform.04.svg.txt} (100%) create mode 100644 test/plugins/convertTransform.05.svg.txt rename test/plugins/{inlineStyles.01.svg => inlineStyles.01.svg.txt} (100%) rename test/plugins/{inlineStyles.02.svg => inlineStyles.02.svg.txt} (100%) rename test/plugins/{inlineStyles.03.svg => inlineStyles.03.svg.txt} (100%) rename test/plugins/{inlineStyles.04.svg => inlineStyles.04.svg.txt} (100%) rename test/plugins/{inlineStyles.05.svg => inlineStyles.05.svg.txt} (100%) rename test/plugins/{inlineStyles.06.svg => inlineStyles.06.svg.txt} (100%) rename test/plugins/{inlineStyles.07.svg => inlineStyles.07.svg.txt} (100%) rename test/plugins/{inlineStyles.08.svg => inlineStyles.08.svg.txt} (100%) rename test/plugins/{inlineStyles.09.svg => inlineStyles.09.svg.txt} (100%) rename test/plugins/{inlineStyles.10.svg => inlineStyles.10.svg.txt} (100%) rename test/plugins/{inlineStyles.11.svg => inlineStyles.11.svg.txt} (100%) rename test/plugins/{inlineStyles.12.svg => inlineStyles.12.svg.txt} (100%) rename test/plugins/{inlineStyles.13.svg => inlineStyles.13.svg.txt} (100%) rename test/plugins/{inlineStyles.14.svg => inlineStyles.14.svg.txt} (100%) rename test/plugins/{inlineStyles.15.svg => inlineStyles.15.svg.txt} (100%) rename test/plugins/{inlineStyles.16.svg => inlineStyles.16.svg.txt} (100%) rename test/plugins/{inlineStyles.17.svg => inlineStyles.17.svg.txt} (100%) rename test/plugins/{inlineStyles.18.svg => inlineStyles.18.svg.txt} (100%) rename test/plugins/{inlineStyles.19.svg => inlineStyles.19.svg.txt} (100%) rename test/plugins/{inlineStyles.20.svg => inlineStyles.20.svg.txt} (100%) rename test/plugins/{inlineStyles.21.svg => inlineStyles.21.svg.txt} (100%) rename test/plugins/{inlineStyles.22.svg => inlineStyles.22.svg.txt} (100%) rename test/plugins/{inlineStyles.23.svg => inlineStyles.23.svg.txt} (100%) rename test/plugins/{inlineStyles.24.svg => inlineStyles.24.svg.txt} (100%) rename test/plugins/{inlineStyles.25.svg => inlineStyles.25.svg.txt} (100%) rename test/plugins/{inlineStyles.26.svg => inlineStyles.26.svg.txt} (100%) rename test/plugins/{inlineStyles.27.svg => inlineStyles.27.svg.txt} (100%) rename test/plugins/{inlineStyles.28.svg => inlineStyles.28.svg.txt} (100%) rename test/plugins/{mergePaths.01.svg => mergePaths.01.svg.txt} (100%) rename test/plugins/{mergePaths.02.svg => mergePaths.02.svg.txt} (100%) rename test/plugins/{mergePaths.03.svg => mergePaths.03.svg.txt} (100%) rename test/plugins/{mergePaths.04.svg => mergePaths.04.svg.txt} (100%) rename test/plugins/{mergePaths.05.svg => mergePaths.05.svg.txt} (100%) rename test/plugins/{mergePaths.06.svg => mergePaths.06.svg.txt} (100%) rename test/plugins/{mergePaths.07.svg => mergePaths.07.svg.txt} (100%) rename test/plugins/{mergeStyles.01.svg => mergeStyles.01.svg.txt} (100%) rename test/plugins/{mergeStyles.02.svg => mergeStyles.02.svg.txt} (100%) rename test/plugins/{mergeStyles.03.svg => mergeStyles.03.svg.txt} (100%) rename test/plugins/{mergeStyles.04.svg => mergeStyles.04.svg.txt} (100%) rename test/plugins/{mergeStyles.05.svg => mergeStyles.05.svg.txt} (100%) rename test/plugins/{mergeStyles.06.svg => mergeStyles.06.svg.txt} (100%) rename test/plugins/{mergeStyles.07.svg => mergeStyles.07.svg.txt} (100%) rename test/plugins/{mergeStyles.08.svg => mergeStyles.08.svg.txt} (100%) rename test/plugins/{mergeStyles.09.svg => mergeStyles.09.svg.txt} (100%) rename test/plugins/{mergeStyles.10.svg => mergeStyles.10.svg.txt} (100%) rename test/plugins/{mergeStyles.11.svg => mergeStyles.11.svg.txt} (100%) rename test/plugins/{mergeStyles.12.svg => mergeStyles.12.svg.txt} (100%) rename test/plugins/{minifyStyles.01.svg => minifyStyles.01.svg.txt} (100%) rename test/plugins/{minifyStyles.02.svg => minifyStyles.02.svg.txt} (100%) rename test/plugins/{minifyStyles.03.svg => minifyStyles.03.svg.txt} (100%) rename test/plugins/{minifyStyles.04.svg => minifyStyles.04.svg.txt} (100%) rename test/plugins/{minifyStyles.05.svg => minifyStyles.05.svg.txt} (100%) rename test/plugins/{minifyStyles.06.svg => minifyStyles.06.svg.txt} (100%) rename test/plugins/{minifyStyles.07.svg => minifyStyles.07.svg.txt} (100%) rename test/plugins/{minifyStyles.08.svg => minifyStyles.08.svg.txt} (100%) rename test/plugins/{minifyStyles.09.svg => minifyStyles.09.svg.txt} (100%) rename test/plugins/{minifyStyles.10.svg => minifyStyles.10.svg.txt} (100%) rename test/plugins/{minifyStyles.11.svg => minifyStyles.11.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.01.svg => moveElemsAttrsToGroup.01.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.02.svg => moveElemsAttrsToGroup.02.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.03.svg => moveElemsAttrsToGroup.03.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.04.svg => moveElemsAttrsToGroup.04.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.06.svg => moveElemsAttrsToGroup.06.svg.txt} (100%) rename test/plugins/{moveElemsAttrsToGroup.07.svg => moveElemsAttrsToGroup.07.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.01.svg => moveGroupAttrsToElems.01.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.02.svg => moveGroupAttrsToElems.02.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.03.svg => moveGroupAttrsToElems.03.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.04.svg => moveGroupAttrsToElems.04.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.05.svg => moveGroupAttrsToElems.05.svg.txt} (100%) rename test/plugins/{moveGroupAttrsToElems.06.svg => moveGroupAttrsToElems.06.svg.txt} (100%) rename test/plugins/{prefixIds.01.svg => prefixIds.01.svg.txt} (62%) rename test/plugins/{prefixIds.02.svg => prefixIds.02.svg.txt} (78%) rename test/plugins/{prefixIds.03.svg => prefixIds.03.svg.txt} (80%) rename test/plugins/{prefixIds.04.svg => prefixIds.04.svg.txt} (94%) rename test/plugins/{prefixIds.05.svg => prefixIds.05.svg.txt} (73%) rename test/plugins/{prefixIds.06.svg => prefixIds.06.svg.txt} (51%) rename test/plugins/{prefixIds.07.svg => prefixIds.07.svg.txt} (78%) rename test/plugins/{prefixIds.08.svg => prefixIds.08.svg.txt} (77%) rename test/plugins/{prefixIds.09.svg => prefixIds.09.svg.txt} (100%) rename test/plugins/{prefixIds.10.svg => prefixIds.10.svg.txt} (53%) rename test/plugins/{prefixIds.11.svg => prefixIds.11.svg.txt} (63%) rename test/plugins/{prefixIds.12.svg => prefixIds.12.svg.txt} (90%) rename test/plugins/{removeAttributesBySelector.01.svg => removeAttributesBySelector.01.svg.txt} (100%) rename test/plugins/{removeAttributesBySelector.02.svg => removeAttributesBySelector.02.svg.txt} (100%) rename test/plugins/{removeAttributesBySelector.03.svg => removeAttributesBySelector.03.svg.txt} (100%) rename test/plugins/{removeAttrs.01.svg => removeAttrs.01.svg.txt} (100%) rename test/plugins/{removeAttrs.02.svg => removeAttrs.02.svg.txt} (100%) rename test/plugins/{removeAttrs.03.svg => removeAttrs.03.svg.txt} (100%) rename test/plugins/{removeAttrs.04.svg => removeAttrs.04.svg.txt} (100%) rename test/plugins/{removeAttrs.05.svg => removeAttrs.05.svg.txt} (100%) rename test/plugins/{removeAttrs.06.svg => removeAttrs.06.svg.txt} (100%) rename test/plugins/{removeComments.01.svg => removeComments.01.svg.txt} (100%) rename test/plugins/{removeComments.02.svg => removeComments.02.svg.txt} (100%) rename test/plugins/{removeComments.03.svg => removeComments.03.svg.txt} (100%) rename test/plugins/{removeDesc.01.svg => removeDesc.01.svg.txt} (100%) rename test/plugins/{removeDimensions.01.svg => removeDimensions.01.svg.txt} (100%) rename test/plugins/{removeDimensions.02.svg => removeDimensions.02.svg.txt} (100%) rename test/plugins/{removeDimensions.03.svg => removeDimensions.03.svg.txt} (100%) rename test/plugins/{removeDimensions.04.svg => removeDimensions.04.svg.txt} (100%) rename test/plugins/{removeDimensions.05.svg => removeDimensions.05.svg.txt} (100%) rename test/plugins/{removeDoctype.01.svg => removeDoctype.01.svg.txt} (100%) rename test/plugins/{removeEditorsNSData.01.svg => removeEditorsNSData.01.svg.txt} (100%) rename test/plugins/{removeEditorsNSData.02.svg => removeEditorsNSData.02.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.01.svg => removeElementsByAttr.01.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.02.svg => removeElementsByAttr.02.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.03.svg => removeElementsByAttr.03.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.04.svg => removeElementsByAttr.04.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.05.svg => removeElementsByAttr.05.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.06.svg => removeElementsByAttr.06.svg.txt} (100%) rename test/plugins/{removeElementsByAttr.07.svg => removeElementsByAttr.07.svg.txt} (100%) rename test/plugins/{removeEmptyAttrs.01.svg => removeEmptyAttrs.01.svg.txt} (100%) rename test/plugins/{removeEmptyAttrs.02.svg => removeEmptyAttrs.02.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.01.svg => removeEmptyContainers.01.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.02.svg => removeEmptyContainers.02.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.03.svg => removeEmptyContainers.03.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.04.svg => removeEmptyContainers.04.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.05.svg => removeEmptyContainers.05.svg.txt} (100%) rename test/plugins/{removeEmptyContainers.06.svg => removeEmptyContainers.06.svg.txt} (100%) rename test/plugins/{removeEmptyText.01.svg => removeEmptyText.01.svg.txt} (100%) rename test/plugins/{removeEmptyText.02.svg => removeEmptyText.02.svg.txt} (100%) rename test/plugins/{removeEmptyText.03.svg => removeEmptyText.03.svg.txt} (100%) rename test/plugins/{removeHiddenElems.01.svg => removeHiddenElems.01.svg.txt} (100%) rename test/plugins/{removeHiddenElems.02.svg => removeHiddenElems.02.svg.txt} (100%) rename test/plugins/{removeHiddenElems.03.svg => removeHiddenElems.03.svg.txt} (100%) rename test/plugins/{removeHiddenElems.04.svg => removeHiddenElems.04.svg.txt} (100%) rename test/plugins/{removeHiddenElems.05.svg => removeHiddenElems.05.svg.txt} (100%) rename test/plugins/{removeHiddenElems.06.svg => removeHiddenElems.06.svg.txt} (100%) rename test/plugins/{removeHiddenElems.07.svg => removeHiddenElems.07.svg.txt} (100%) rename test/plugins/{removeHiddenElems.08.svg => removeHiddenElems.08.svg.txt} (100%) rename test/plugins/{removeHiddenElems.09.svg => removeHiddenElems.09.svg.txt} (100%) rename test/plugins/{removeHiddenElems.10.svg => removeHiddenElems.10.svg.txt} (100%) rename test/plugins/{removeHiddenElems.11.svg => removeHiddenElems.11.svg.txt} (100%) rename test/plugins/{removeHiddenElems.12.svg => removeHiddenElems.12.svg.txt} (100%) rename test/plugins/{removeHiddenElems.13.svg => removeHiddenElems.13.svg.txt} (100%) rename test/plugins/{removeHiddenElems.14.svg => removeHiddenElems.14.svg.txt} (100%) rename test/plugins/{removeHiddenElems.15.svg => removeHiddenElems.15.svg.txt} (100%) rename test/plugins/{removeMetadata.01.svg => removeMetadata.01.svg.txt} (100%) rename test/plugins/{removeNonInheritableGroupAttrs.01.svg => removeNonInheritableGroupAttrs.01.svg.txt} (100%) rename test/plugins/{removeNonInheritableGroupAttrs.02.svg => removeNonInheritableGroupAttrs.02.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.01.svg => removeOffCanvasPaths.01.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.02.svg => removeOffCanvasPaths.02.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.03.svg => removeOffCanvasPaths.03.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.04.svg => removeOffCanvasPaths.04.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.05.svg => removeOffCanvasPaths.05.svg.txt} (100%) rename test/plugins/{removeOffCanvasPaths.06.svg => removeOffCanvasPaths.06.svg.txt} (100%) rename test/plugins/{removeRasterImages.01.svg => removeRasterImages.01.svg.txt} (100%) rename test/plugins/{removeRasterImages.02.svg => removeRasterImages.02.svg.txt} (100%) rename test/plugins/{removeScriptElement.01.svg => removeScriptElement.01.svg.txt} (100%) rename test/plugins/{removeScriptElement.02.svg => removeScriptElement.02.svg.txt} (100%) rename test/plugins/{removeScriptElement.03.svg => removeScriptElement.03.svg.txt} (100%) rename test/plugins/{removeScriptElement.04.svg => removeScriptElement.04.svg.txt} (100%) rename test/plugins/{removeScriptElement.05.svg => removeScriptElement.05.svg.txt} (100%) rename test/plugins/{removeStyleElement.01.svg => removeStyleElement.01.svg.txt} (100%) rename test/plugins/{removeTitle.01.svg => removeTitle.01.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.01.svg => removeUnknownsAndDefaults.01.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.02.svg => removeUnknownsAndDefaults.02.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.03.svg => removeUnknownsAndDefaults.03.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.04.svg => removeUnknownsAndDefaults.04.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.05.svg => removeUnknownsAndDefaults.05.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.06.svg => removeUnknownsAndDefaults.06.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.07.svg => removeUnknownsAndDefaults.07.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.08.svg => removeUnknownsAndDefaults.08.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.09.svg => removeUnknownsAndDefaults.09.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.10.svg => removeUnknownsAndDefaults.10.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.11.svg => removeUnknownsAndDefaults.11.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.12.svg => removeUnknownsAndDefaults.12.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.13.svg => removeUnknownsAndDefaults.13.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.14.svg => removeUnknownsAndDefaults.14.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.15.svg => removeUnknownsAndDefaults.15.svg.txt} (100%) rename test/plugins/{removeUnknownsAndDefaults.16.svg => removeUnknownsAndDefaults.16.svg.txt} (100%) rename test/plugins/{removeUnusedNS.01.svg => removeUnusedNS.01.svg.txt} (100%) rename test/plugins/{removeUnusedNS.02.svg => removeUnusedNS.02.svg.txt} (100%) rename test/plugins/{removeUnusedNS.03.svg => removeUnusedNS.03.svg.txt} (100%) rename test/plugins/{removeUnusedNS.04.svg => removeUnusedNS.04.svg.txt} (100%) rename test/plugins/{removeUnusedNS.05.svg => removeUnusedNS.05.svg.txt} (100%) rename test/plugins/{removeUnusedNS.06.svg => removeUnusedNS.06.svg.txt} (100%) rename test/plugins/{removeUnusedNS.07.svg => removeUnusedNS.07.svg.txt} (100%) rename test/plugins/{removeUselessDefs.01.svg => removeUselessDefs.01.svg.txt} (100%) rename test/plugins/{removeUselessDefs.02.svg => removeUselessDefs.02.svg.txt} (100%) rename test/plugins/{removeUselessDefs.03.svg => removeUselessDefs.03.svg.txt} (100%) create mode 100644 test/plugins/removeUselessDefs.04.svg.txt create mode 100644 test/plugins/removeUselessDefs.05.svg.txt rename test/plugins/{removeUselessStrokeAndFill.01.svg => removeUselessStrokeAndFill.01.svg.txt} (100%) rename test/plugins/{removeUselessStrokeAndFill.02.svg => removeUselessStrokeAndFill.02.svg.txt} (100%) rename test/plugins/{removeUselessStrokeAndFill.03.svg => removeUselessStrokeAndFill.03.svg.txt} (100%) rename test/plugins/{removeUselessStrokeAndFill.04.svg => removeUselessStrokeAndFill.04.svg.txt} (100%) rename test/plugins/{removeUselessStrokeAndFill.05.svg => removeUselessStrokeAndFill.05.svg.txt} (100%) rename test/plugins/{removeViewBox.01.svg => removeViewBox.01.svg.txt} (100%) rename test/plugins/{removeViewBox.02.svg => removeViewBox.02.svg.txt} (100%) rename test/plugins/{removeViewBox.03.svg => removeViewBox.03.svg.txt} (100%) rename test/plugins/{removeViewBox.04.svg => removeViewBox.04.svg.txt} (100%) rename test/plugins/{removeViewBox.05.svg => removeViewBox.05.svg.txt} (100%) rename test/plugins/{removeXMLNS.01.svg => removeXMLNS.01.svg.txt} (100%) rename test/plugins/{removeXMLProcInst.01.svg => removeXMLProcInst.01.svg.txt} (100%) rename test/plugins/{removeXMLProcInst.02.svg => removeXMLProcInst.02.svg.txt} (100%) rename test/plugins/{removeXlink.01.svg => removeXlink.01.svg.txt} (100%) rename test/plugins/{removeXlink.02.svg => removeXlink.02.svg.txt} (100%) rename test/plugins/{removeXlink.03.svg => removeXlink.03.svg.txt} (100%) rename test/plugins/{removeXlink.04.svg => removeXlink.04.svg.txt} (100%) rename test/plugins/{reusePaths.01.svg => reusePaths.01.svg.txt} (100%) rename test/plugins/{reusePaths.02.svg => reusePaths.02.svg.txt} (100%) rename test/plugins/{reusePaths.03.svg => reusePaths.03.svg.txt} (100%) rename test/plugins/{reusePaths.04.svg => reusePaths.04.svg.txt} (100%) rename test/plugins/{reusePaths.05.svg => reusePaths.05.svg.txt} (100%) rename test/plugins/{reusePaths.06.svg => reusePaths.06.svg.txt} (100%) rename test/plugins/{sortAttrs.01.svg => sortAttrs.01.svg.txt} (100%) rename test/plugins/{sortAttrs.02.svg => sortAttrs.02.svg.txt} (100%) rename test/plugins/{sortAttrs.03.svg => sortAttrs.03.svg.txt} (100%) rename test/plugins/{sortAttrs.04.svg => sortAttrs.04.svg.txt} (100%) rename test/plugins/{sortDefsChildren.01.svg => sortDefsChildren.01.svg.txt} (100%) create mode 100644 test/svgo.cjs diff --git a/.eslintrc b/.eslintrc index db390436e..3ca4095d5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,7 @@ { "parserOptions": { - "ecmaVersion": 2021 + "ecmaVersion": 2021, + "sourceType": "module" }, "env": { "node": true, @@ -8,12 +9,6 @@ }, "extends": ["eslint:recommended"], "overrides": [ - { - "files": ["rollup.config.js", "**/*.mjs"], - "parserOptions": { - "sourceType": "module" - } - }, { "files": ["**/*.cjs"], "parserOptions": { diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42af4a390..684a8d1cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,6 @@ jobs: - 20 - 18 - 16 - - 14 os: - ubuntu-latest - windows-latest @@ -61,4 +60,4 @@ jobs: - run: yarn install - run: yarn playwright install --with-deps chromium - run: yarn test - - run: yarn test-browser + - run: yarn test-bundles diff --git a/.gitignore b/.gitignore index 1c9775de0..f834ff6ac 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ test/regression-diffs test/cli/output coverage .DS_Store +.vscode *.log diff --git a/README.md b/README.md index 080a93c6d..953419f9a 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ SVGO reads the configuration from `svgo.config.js` or the `--config path/to/conf **`svgo.config.js`** ```js -module.exports = { +export default { multipass: false, // boolean datauri: 'base64', // 'base64'|'enc'|'unenc' js2svg: { @@ -83,7 +83,7 @@ Instead of configuring SVGO from scratch, you can tweak the default preset to su **`svgo.config.js`** ```js -module.exports = { +export default { plugins: [ { name: 'preset-default', @@ -112,9 +112,9 @@ You can also specify custom plugins: **`svgo.config.js`** ```js -const importedPlugin = require('./imported-plugin'); +import importedPlugin from './imported-plugin'; -module.exports = { +export default { plugins: [ // plugin imported from another JavaScript file importedPlugin, @@ -140,7 +140,7 @@ SVGO provides a few low level utilities. The core of SVGO is `optimize` function. ```js -const { optimize } = require('svgo'); +import { optimize } from 'svgo'; const result = optimize(svgString, { path: 'path-to.svg', // recommended @@ -155,7 +155,7 @@ const optimizedSvgString = result.data; If you write a tool on top of SVGO you may want to resolve the `svgo.config.js` file. ```js -const { loadConfig } = require('svgo'); +import { loadConfig } from 'svgo'; const config = await loadConfig(); ``` diff --git a/bin/svgo b/bin/svgo.js similarity index 55% rename from bin/svgo rename to bin/svgo.js index cbca2b043..a498b8586 100755 --- a/bin/svgo +++ b/bin/svgo.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -const colors = require('picocolors'); -const { program } = require('commander'); -const makeProgram = require('../lib/svgo/coa'); +import colors from 'picocolors'; +import { program } from 'commander'; +import makeProgram from '../lib/svgo/coa.js'; makeProgram(program); program.parseAsync(process.argv).catch((error) => { console.error(colors.red(error.stack)); diff --git a/docs/03-plugins/convert-path-data.mdx b/docs/03-plugins/convert-path-data.mdx index 66848688f..1f1dc3cdd 100644 --- a/docs/03-plugins/convert-path-data.mdx +++ b/docs/03-plugins/convert-path-data.mdx @@ -15,6 +15,9 @@ svgo: straightCurves: description: If to convert curve commands that are effectively straight lines to line commands. default: true + convertToQ: + description: If to convert cubic beziers to quadratic beziers when they effectively are. + default: true lineShorthands: description: If to convert regular lines to an explicit horizontal or vertical line where possible. default: true diff --git a/lib/builtin.js b/lib/builtin.js index 97845d278..f4cd95cb9 100644 --- a/lib/builtin.js +++ b/lib/builtin.js @@ -1,58 +1,111 @@ -'use strict'; +import presetDefault from '../plugins/preset-default.js'; +import * as addAttributesToSVGElement from '../plugins/addAttributesToSVGElement.js'; +import * as addClassesToSVGElement from '../plugins/addClassesToSVGElement.js'; +import * as cleanupAttrs from '../plugins/cleanupAttrs.js'; +import * as cleanupEnableBackground from '../plugins/cleanupEnableBackground.js'; +import * as cleanupIds from '../plugins/cleanupIds.js'; +import * as cleanupListOfValues from '../plugins/cleanupListOfValues.js'; +import * as cleanupNumericValues from '../plugins/cleanupNumericValues.js'; +import * as collapseGroups from '../plugins/collapseGroups.js'; +import * as convertColors from '../plugins/convertColors.js'; +import * as convertEllipseToCircle from '../plugins/convertEllipseToCircle.js'; +import * as convertOneStopGradients from '../plugins/convertOneStopGradients.js'; +import * as convertPathData from '../plugins/convertPathData.js'; +import * as convertShapeToPath from '../plugins/convertShapeToPath.js'; +import * as convertStyleToAttrs from '../plugins/convertStyleToAttrs.js'; +import * as convertTransform from '../plugins/convertTransform.js'; +import * as mergeStyles from '../plugins/mergeStyles.js'; +import * as inlineStyles from '../plugins/inlineStyles.js'; +import * as mergePaths from '../plugins/mergePaths.js'; +import * as minifyStyles from '../plugins/minifyStyles.js'; +import * as moveElemsAttrsToGroup from '../plugins/moveElemsAttrsToGroup.js'; +import * as moveGroupAttrsToElems from '../plugins/moveGroupAttrsToElems.js'; +import * as optimizePathOrder from '../plugins/optimizePathOrder.js'; +import * as prefixIds from '../plugins/prefixIds.js'; +import * as removeAttributesBySelector from '../plugins/removeAttributesBySelector.js'; +import * as removeAttrs from '../plugins/removeAttrs.js'; +import * as removeComments from '../plugins/removeComments.js'; +import * as removeDesc from '../plugins/removeDesc.js'; +import * as removeDimensions from '../plugins/removeDimensions.js'; +import * as removeDoctype from '../plugins/removeDoctype.js'; +import * as removeEditorsNSData from '../plugins/removeEditorsNSData.js'; +import * as removeElementsByAttr from '../plugins/removeElementsByAttr.js'; +import * as removeEmptyAttrs from '../plugins/removeEmptyAttrs.js'; +import * as removeEmptyContainers from '../plugins/removeEmptyContainers.js'; +import * as removeEmptyText from '../plugins/removeEmptyText.js'; +import * as removeHiddenElems from '../plugins/removeHiddenElems.js'; +import * as removeMetadata from '../plugins/removeMetadata.js'; +import * as removeNonInheritableGroupAttrs from '../plugins/removeNonInheritableGroupAttrs.js'; +import * as removeOffCanvasPaths from '../plugins/removeOffCanvasPaths.js'; +import * as removeRasterImages from '../plugins/removeRasterImages.js'; +import * as removeScriptElement from '../plugins/removeScriptElement.js'; +import * as removeStyleElement from '../plugins/removeStyleElement.js'; +import * as removeTitle from '../plugins/removeTitle.js'; +import * as removeUnknownsAndDefaults from '../plugins/removeUnknownsAndDefaults.js'; +import * as removeUnusedNS from '../plugins/removeUnusedNS.js'; +import * as removeUselessDefs from '../plugins/removeUselessDefs.js'; +import * as removeUselessStrokeAndFill from '../plugins/removeUselessStrokeAndFill.js'; +import * as removeViewBox from '../plugins/removeViewBox.js'; +import * as removeXlink from '../plugins/removeXlink.js'; +import * as removeXMLNS from '../plugins/removeXMLNS.js'; +import * as removeXMLProcInst from '../plugins/removeXMLProcInst.js'; +import * as reusePaths from '../plugins/reusePaths.js'; +import * as sortAttrs from '../plugins/sortAttrs.js'; +import * as sortDefsChildren from '../plugins/sortDefsChildren.js'; -exports.builtin = [ - require('../plugins/preset-default.js'), - require('../plugins/addAttributesToSVGElement.js'), - require('../plugins/addClassesToSVGElement.js'), - require('../plugins/cleanupAttrs.js'), - require('../plugins/cleanupEnableBackground.js'), - require('../plugins/cleanupIds.js'), - require('../plugins/cleanupListOfValues.js'), - require('../plugins/cleanupNumericValues.js'), - require('../plugins/collapseGroups.js'), - require('../plugins/convertColors.js'), - require('../plugins/convertEllipseToCircle.js'), - require('../plugins/convertOneStopGradients.js'), - require('../plugins/convertPathData.js'), - require('../plugins/convertShapeToPath.js'), - require('../plugins/convertStyleToAttrs.js'), - require('../plugins/convertTransform.js'), - require('../plugins/mergeStyles.js'), - require('../plugins/inlineStyles.js'), - require('../plugins/mergePaths.js'), - require('../plugins/minifyStyles.js'), - require('../plugins/moveElemsAttrsToGroup.js'), - require('../plugins/moveGroupAttrsToElems.js'), - require('../plugins/optimizePathOrder.js'), - require('../plugins/prefixIds.js'), - require('../plugins/removeAttributesBySelector.js'), - require('../plugins/removeAttrs.js'), - require('../plugins/removeComments.js'), - require('../plugins/removeDesc.js'), - require('../plugins/removeDimensions.js'), - require('../plugins/removeDoctype.js'), - require('../plugins/removeEditorsNSData.js'), - require('../plugins/removeElementsByAttr.js'), - require('../plugins/removeEmptyAttrs.js'), - require('../plugins/removeEmptyContainers.js'), - require('../plugins/removeEmptyText.js'), - require('../plugins/removeHiddenElems.js'), - require('../plugins/removeMetadata.js'), - require('../plugins/removeNonInheritableGroupAttrs.js'), - require('../plugins/removeOffCanvasPaths.js'), - require('../plugins/removeRasterImages.js'), - require('../plugins/removeScriptElement.js'), - require('../plugins/removeStyleElement.js'), - require('../plugins/removeTitle.js'), - require('../plugins/removeUnknownsAndDefaults.js'), - require('../plugins/removeUnusedNS.js'), - require('../plugins/removeUselessDefs.js'), - require('../plugins/removeUselessStrokeAndFill.js'), - require('../plugins/removeViewBox.js'), - require('../plugins/removeXlink.js'), - require('../plugins/removeXMLNS.js'), - require('../plugins/removeXMLProcInst.js'), - require('../plugins/reusePaths.js'), - require('../plugins/sortAttrs.js'), - require('../plugins/sortDefsChildren.js'), +export const builtin = [ + presetDefault, + addAttributesToSVGElement, + addClassesToSVGElement, + cleanupAttrs, + cleanupEnableBackground, + cleanupIds, + cleanupListOfValues, + cleanupNumericValues, + collapseGroups, + convertColors, + convertEllipseToCircle, + convertOneStopGradients, + convertPathData, + convertShapeToPath, + convertStyleToAttrs, + convertTransform, + mergeStyles, + inlineStyles, + mergePaths, + minifyStyles, + moveElemsAttrsToGroup, + moveGroupAttrsToElems, + optimizePathOrder, + prefixIds, + removeAttributesBySelector, + removeAttrs, + removeComments, + removeDesc, + removeDimensions, + removeDoctype, + removeEditorsNSData, + removeElementsByAttr, + removeEmptyAttrs, + removeEmptyContainers, + removeEmptyText, + removeHiddenElems, + removeMetadata, + removeNonInheritableGroupAttrs, + removeOffCanvasPaths, + removeRasterImages, + removeScriptElement, + removeStyleElement, + removeTitle, + removeUnknownsAndDefaults, + removeUnusedNS, + removeUselessDefs, + removeUselessStrokeAndFill, + removeViewBox, + removeXlink, + removeXMLNS, + removeXMLProcInst, + reusePaths, + sortAttrs, + sortDefsChildren, ]; diff --git a/lib/parser.js b/lib/parser.js index 4637acf15..71aa3293d 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,21 +1,19 @@ -'use strict'; - /** - * @typedef {import('./types').XastNode} XastNode - * @typedef {import('./types').XastInstruction} XastInstruction - * @typedef {import('./types').XastDoctype} XastDoctype - * @typedef {import('./types').XastComment} XastComment - * @typedef {import('./types').XastRoot} XastRoot - * @typedef {import('./types').XastElement} XastElement - * @typedef {import('./types').XastCdata} XastCdata - * @typedef {import('./types').XastText} XastText - * @typedef {import('./types').XastParent} XastParent - * @typedef {import('./types').XastChild} XastChild + * @typedef {import('./types.js').XastNode} XastNode + * @typedef {import('./types.js').XastInstruction} XastInstruction + * @typedef {import('./types.js').XastDoctype} XastDoctype + * @typedef {import('./types.js').XastComment} XastComment + * @typedef {import('./types.js').XastRoot} XastRoot + * @typedef {import('./types.js').XastElement} XastElement + * @typedef {import('./types.js').XastCdata} XastCdata + * @typedef {import('./types.js').XastText} XastText + * @typedef {import('./types.js').XastParent} XastParent + * @typedef {import('./types.js').XastChild} XastChild */ // @ts-ignore sax will be replaced with something else later -const SAX = require('@trysound/sax'); -const { textElems } = require('../plugins/_collections'); +import SAX from '@trysound/sax'; +import { textElems } from '../plugins/_collections.js'; class SvgoParserError extends Error { /** @@ -89,7 +87,7 @@ const config = { * * @type {(data: string, from?: string) => XastRoot} */ -const parseSvg = (data, from) => { +export const parseSvg = (data, from) => { const sax = SAX.parser(config.strict, config); /** * @type {XastRoot} @@ -259,4 +257,3 @@ const parseSvg = (data, from) => { sax.write(data).close(); return root; }; -exports.parseSvg = parseSvg; diff --git a/lib/path.js b/lib/path.js index 8e6b47221..8fb4e3fe0 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1,10 +1,8 @@ -'use strict'; - -const { removeLeadingZero } = require('./svgo/tools'); +import { removeLeadingZero, toFixed } from './svgo/tools.js'; /** - * @typedef {import('./types').PathDataItem} PathDataItem - * @typedef {import('./types').PathDataCommand} PathDataCommand + * @typedef {import('./types.js').PathDataItem} PathDataItem + * @typedef {import('./types.js').PathDataCommand} PathDataCommand */ // Based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF @@ -137,7 +135,7 @@ const readNumber = (string, cursor) => { /** * @type {(string: string) => PathDataItem[]} */ -const parsePathData = (string) => { +export const parsePathData = (string) => { /** * @type {PathDataItem[]} */ @@ -240,7 +238,6 @@ const parsePathData = (string) => { } return pathData; }; -exports.parsePathData = parsePathData; /** * @type {(number: number, precision?: number) => { @@ -250,8 +247,7 @@ exports.parsePathData = parsePathData; */ const roundAndStringify = (number, precision) => { if (precision != null) { - const ratio = 10 ** precision; - number = Math.round(number * ratio) / ratio; + number = toFixed(number, precision); } return { @@ -317,7 +313,11 @@ const stringifyArgs = (command, args, precision, disableSpaceAfterFlags) => { * @param {StringifyPathDataOptions} options * @returns {string} */ -const stringifyPathData = ({ pathData, precision, disableSpaceAfterFlags }) => { +export const stringifyPathData = ({ + pathData, + precision, + disableSpaceAfterFlags, +}) => { if (pathData.length === 1) { const { command, args } = pathData[0]; return ( @@ -378,4 +378,3 @@ const stringifyPathData = ({ pathData, precision, disableSpaceAfterFlags }) => { return result; }; -exports.stringifyPathData = stringifyPathData; diff --git a/lib/path.test.js b/lib/path.test.js index 91e6eaa91..2ff353835 100644 --- a/lib/path.test.js +++ b/lib/path.test.js @@ -1,62 +1,60 @@ -'use strict'; +import { parsePathData, stringifyPathData } from './path.js'; /** - * @typedef {import('../lib/types').PathDataItem} PathDataItem + * @typedef {import('../lib/types.js').PathDataItem} PathDataItem */ -const { parsePathData, stringifyPathData } = require('./path.js'); - describe('parse path data', () => { it('should allow spaces between commands', () => { - expect(parsePathData('M0 10 L \n\r\t20 30')).toEqual([ + expect(parsePathData('M0 10 L \n\r\t20 30')).toStrictEqual([ { command: 'M', args: [0, 10] }, { command: 'L', args: [20, 30] }, ]); }); it('should allow spaces and commas between arguments', () => { - expect(parsePathData('M0 , 10 L 20 \n\r\t30,40,50')).toEqual([ + expect(parsePathData('M0 , 10 L 20 \n\r\t30,40,50')).toStrictEqual([ { command: 'M', args: [0, 10] }, { command: 'L', args: [20, 30] }, { command: 'L', args: [40, 50] }, ]); }); it('should forbid commas before commands', () => { - expect(parsePathData(', M0 10')).toEqual([]); + expect(parsePathData(', M0 10')).toStrictEqual([]); }); it('should forbid commas between commands', () => { - expect(parsePathData('M0,10 , L 20,30')).toEqual([ + expect(parsePathData('M0,10 , L 20,30')).toStrictEqual([ { command: 'M', args: [0, 10] }, ]); }); it('should forbid commas between command name and argument', () => { - expect(parsePathData('M0,10 L,20,30')).toEqual([ + expect(parsePathData('M0,10 L,20,30')).toStrictEqual([ { command: 'M', args: [0, 10] }, ]); }); it('should forbid multiple commas in a row', () => { - expect(parsePathData('M0 , , 10')).toEqual([]); + expect(parsePathData('M0 , , 10')).toStrictEqual([]); }); it('should stop when unknown char appears', () => { - expect(parsePathData('M0 10 , L 20 #40')).toEqual([ + expect(parsePathData('M0 10 , L 20 #40')).toStrictEqual([ { command: 'M', args: [0, 10] }, ]); }); it('should stop when not enough arguments', () => { - expect(parsePathData('M0 10 L 20 L 30 40')).toEqual([ + expect(parsePathData('M0 10 L 20 L 30 40')).toStrictEqual([ { command: 'M', args: [0, 10] }, ]); }); it('should stop if moveto not the first command', () => { - expect(parsePathData('L 10 20')).toEqual([]); - expect(parsePathData('10 20')).toEqual([]); + expect(parsePathData('L 10 20')).toStrictEqual([]); + expect(parsePathData('10 20')).toStrictEqual([]); }); it('should stop on invalid scientific notation', () => { - expect(parsePathData('M 0 5e++1 L 0 0')).toEqual([ + expect(parsePathData('M 0 5e++1 L 0 0')).toStrictEqual([ { command: 'M', args: [0, 5] }, ]); }); it('should stop on invalid numbers', () => { - expect(parsePathData('M ...')).toEqual([]); + expect(parsePathData('M ...')).toStrictEqual([]); }); it('should handle arcs', () => { expect( @@ -71,7 +69,7 @@ describe('parse path data', () => { l 50,-25 `, ), - ).toEqual([ + ).toStrictEqual([ { command: 'M', args: [600, 350] }, { command: 'l', args: [50, -25] }, { command: 'a', args: [25, 25, -30, 0, 1, 50, -25] }, @@ -96,7 +94,7 @@ describe('stringify path data', () => { { command: 'H', args: [50] }, ], }), - ).toEqual('M0 0h10 20 30H40 50'); + ).toBe('M0 0h10 20 30H40 50'); }); it('should not combine sequence of moveto', () => { expect( @@ -108,7 +106,7 @@ describe('stringify path data', () => { { command: 'm', args: [40, 50] }, ], }), - ).toEqual('M0 0M10 10m20 30m40 50'); + ).toBe('M0 0M10 10m20 30m40 50'); }); it('should combine moveto and sequence of lineto', () => { expect( @@ -122,7 +120,7 @@ describe('stringify path data', () => { { command: 'L', args: [10, 10] }, ], }), - ).toEqual('m0 0 10 10M0 0l10 10M0 0 10 10'); + ).toBe('m0 0 10 10M0 0l10 10M0 0 10 10'); expect( stringifyPathData({ pathData: [ @@ -130,7 +128,7 @@ describe('stringify path data', () => { { command: 'L', args: [10, 10] }, ], }), - ).toEqual('M0 0 10 10'); + ).toBe('M0 0 10 10'); }); it('should avoid space before first, negative and decimals', () => { expect( @@ -142,7 +140,7 @@ describe('stringify path data', () => { { command: 'L', args: [7, 0.8] }, ], }), - ).toEqual('M0-1.2.3 4 5-.6 7 .8'); + ).toBe('M0-1.2.3 4 5-.6 7 .8'); }); it('should configure precision', () => { /** @@ -159,13 +157,13 @@ describe('stringify path data', () => { pathData, precision: 3, }), - ).toEqual('M0-1.988.3 3.142-.3-3.142 100 200'); + ).toBe('M0-1.988.3 3.142-.3-3.142 100 200'); expect( stringifyPathData({ pathData, precision: 0, }), - ).toEqual('M0-2 0 3 0-3 100 200'); + ).toBe('M0-2 0 3 0-3 100 200'); }); it('allows to avoid spaces after arc flags', () => { /** @@ -182,12 +180,12 @@ describe('stringify path data', () => { pathData, disableSpaceAfterFlags: false, }), - ).toEqual('M0 0A50 50 10 1 0 .2 20a50 50 10 1 0 .2 20 50 50 10 1 0 .2 20'); + ).toBe('M0 0A50 50 10 1 0 .2 20a50 50 10 1 0 .2 20 50 50 10 1 0 .2 20'); expect( stringifyPathData({ pathData, disableSpaceAfterFlags: true, }), - ).toEqual('M0 0A50 50 10 10.2 20a50 50 10 10.2 20 50 50 10 10.2 20'); + ).toBe('M0 0A50 50 10 10.2 20a50 50 10 10.2 20 50 50 10 10.2 20'); }); }); diff --git a/lib/stringifier.js b/lib/stringifier.js index 1a710869d..83b8e12f3 100644 --- a/lib/stringifier.js +++ b/lib/stringifier.js @@ -1,28 +1,20 @@ -'use strict'; - -/** - * @typedef {import('./types').XastParent} XastParent - * @typedef {import('./types').XastRoot} XastRoot - * @typedef {import('./types').XastElement} XastElement - * @typedef {import('./types').XastInstruction} XastInstruction - * @typedef {import('./types').XastDoctype} XastDoctype - * @typedef {import('./types').XastText} XastText - * @typedef {import('./types').XastCdata} XastCdata - * @typedef {import('./types').XastComment} XastComment - * @typedef {import('./types').StringifyOptions} StringifyOptions - */ - -const { textElems } = require('../plugins/_collections'); +import { textElems } from '../plugins/_collections.js'; /** + * @typedef {import('./types.js').XastParent} XastParent + * @typedef {import('./types.js').XastRoot} XastRoot + * @typedef {import('./types.js').XastElement} XastElement + * @typedef {import('./types.js').XastInstruction} XastInstruction + * @typedef {import('./types.js').XastDoctype} XastDoctype + * @typedef {import('./types.js').XastText} XastText + * @typedef {import('./types.js').XastCdata} XastCdata + * @typedef {import('./types.js').XastComment} XastComment + * @typedef {import('./types.js').StringifyOptions} StringifyOptions * @typedef {{ * indent: string, * textContext: ?XastElement, * indentLevel: number, * }} State - */ - -/** * @typedef {Required} Options */ @@ -77,7 +69,7 @@ const entities = { * * @type {(data: XastRoot, config: StringifyOptions) => string} */ -const stringifySvg = (data, userOptions = {}) => { +export const stringifySvg = (data, userOptions = {}) => { /** * @type {Options} */ @@ -114,7 +106,6 @@ const stringifySvg = (data, userOptions = {}) => { } return svg; }; -exports.stringifySvg = stringifySvg; /** * @type {(node: XastParent, config: Options, state: State) => string} diff --git a/lib/style.js b/lib/style.js index 0e62afb92..859bc6c96 100644 --- a/lib/style.js +++ b/lib/style.js @@ -1,30 +1,26 @@ -'use strict'; +import * as csstree from 'css-tree'; +import * as csswhat from 'css-what'; +import { syntax } from 'csso'; +import { visit, matches } from './xast.js'; +import { + attrsGroups, + inheritableAttrs, + presentationNonInheritableGroupAttrs, +} from '../plugins/_collections.js'; /** * @typedef {import('css-tree').Rule} CsstreeRule - * @typedef {import('./types').Specificity} Specificity - * @typedef {import('./types').Stylesheet} Stylesheet - * @typedef {import('./types').StylesheetRule} StylesheetRule - * @typedef {import('./types').StylesheetDeclaration} StylesheetDeclaration - * @typedef {import('./types').ComputedStyles} ComputedStyles - * @typedef {import('./types').XastRoot} XastRoot - * @typedef {import('./types').XastElement} XastElement - * @typedef {import('./types').XastParent} XastParent - * @typedef {import('./types').XastChild} XastChild + * @typedef {import('./types.js').Specificity} Specificity + * @typedef {import('./types.js').Stylesheet} Stylesheet + * @typedef {import('./types.js').StylesheetRule} StylesheetRule + * @typedef {import('./types.js').StylesheetDeclaration} StylesheetDeclaration + * @typedef {import('./types.js').ComputedStyles} ComputedStyles + * @typedef {import('./types.js').XastRoot} XastRoot + * @typedef {import('./types.js').XastElement} XastElement + * @typedef {import('./types.js').XastParent} XastParent + * @typedef {import('./types.js').XastChild} XastChild */ -const csstree = require('css-tree'); -const csswhat = require('css-what'); -const { - syntax: { specificity }, -} = require('csso'); -const { visit, matches } = require('./xast.js'); -const { - attrsGroups, - inheritableAttrs, - presentationNonInheritableGroupAttrs, -} = require('../plugins/_collections.js'); - // @ts-ignore not defined in @types/csstree const csstreeWalkSkip = csstree.walk.skip; @@ -60,7 +56,7 @@ const parseRule = (ruleNode, dynamic) => { } }); rules.push({ - specificity: specificity(node), + specificity: syntax.specificity(node), dynamic: hasPseudoClasses || dynamic, // compute specificity from original node to consider pseudo classes selector: csstree.generate(newNode), @@ -201,7 +197,7 @@ const computeOwnStyle = (stylesheet, node) => { * @param {Specificity} b * @returns {number} */ -const compareSpecificity = (a, b) => { +export const compareSpecificity = (a, b) => { for (let i = 0; i < 4; i += 1) { if (a[i] < b[i]) { return -1; @@ -212,12 +208,11 @@ const compareSpecificity = (a, b) => { return 0; }; -exports.compareSpecificity = compareSpecificity; /** * @type {(root: XastRoot) => Stylesheet} */ -const collectStylesheet = (root) => { +export const collectStylesheet = (root) => { /** @type {StylesheetRule[]} */ const rules = []; /** @type {Map} */ @@ -253,14 +248,13 @@ const collectStylesheet = (root) => { rules.sort((a, b) => compareSpecificity(a.specificity, b.specificity)); return { rules, parents }; }; -exports.collectStylesheet = collectStylesheet; /** * @param {Stylesheet} stylesheet * @param {XastElement} node * @returns {ComputedStyles} */ -const computeStyle = (stylesheet, node) => { +export const computeStyle = (stylesheet, node) => { const { parents } = stylesheet; const computedStyles = computeOwnStyle(stylesheet, node); let parent = parents.get(node); @@ -279,7 +273,6 @@ const computeStyle = (stylesheet, node) => { } return computedStyles; }; -exports.computeStyle = computeStyle; /** * Determines if the CSS selector includes or traverses the given attribute. @@ -294,7 +287,7 @@ exports.computeStyle = computeStyle; * @param {boolean} traversed * @returns {boolean} */ -const includesAttrSelector = ( +export const includesAttrSelector = ( selector, name, value = null, @@ -333,4 +326,3 @@ const includesAttrSelector = ( return false; }; -exports.includesAttrSelector = includesAttrSelector; diff --git a/lib/style.test.js b/lib/style.test.js index b5e1b2c72..2d3fc95d2 100644 --- a/lib/style.test.js +++ b/lib/style.test.js @@ -1,14 +1,12 @@ -'use strict'; +import { collectStylesheet, computeStyle } from './style.js'; +import { visit } from './xast.js'; +import { parseSvg } from './parser.js'; /** - * @typedef {import('./types').XastParent} XastParent - * @typedef {import('./types').XastElement} XastElement + * @typedef {import('./types.js').XastParent} XastParent + * @typedef {import('./types.js').XastElement} XastElement */ -const { collectStylesheet, computeStyle } = require('./style.js'); -const { visit } = require('./xast.js'); -const { parseSvg } = require('./parser.js'); - /** * @type {(node: XastParent, id: string) => XastElement} */ @@ -58,31 +56,35 @@ it('collects styles', () => { `); const stylesheet = collectStylesheet(root); - expect(computeStyle(stylesheet, getElementById(root, 'class'))).toEqual({ - fill: { type: 'static', inherited: false, value: 'red' }, - }); - expect(computeStyle(stylesheet, getElementById(root, 'two-classes'))).toEqual( + expect(computeStyle(stylesheet, getElementById(root, 'class'))).toStrictEqual( { - fill: { type: 'static', inherited: false, value: 'green' }, - stroke: { type: 'static', inherited: false, value: 'black' }, + fill: { type: 'static', inherited: false, value: 'red' }, }, ); - expect(computeStyle(stylesheet, getElementById(root, 'attribute'))).toEqual({ + expect( + computeStyle(stylesheet, getElementById(root, 'two-classes')), + ).toStrictEqual({ + fill: { type: 'static', inherited: false, value: 'green' }, + stroke: { type: 'static', inherited: false, value: 'black' }, + }); + expect( + computeStyle(stylesheet, getElementById(root, 'attribute')), + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'purple' }, }); expect( computeStyle(stylesheet, getElementById(root, 'inline-style')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'grey' }, }); - expect(computeStyle(stylesheet, getElementById(root, 'inheritance'))).toEqual( - { - fill: { type: 'static', inherited: true, value: 'yellow' }, - }, - ); + expect( + computeStyle(stylesheet, getElementById(root, 'inheritance')), + ).toStrictEqual({ + fill: { type: 'static', inherited: true, value: 'yellow' }, + }); expect( computeStyle(stylesheet, getElementById(root, 'nested-inheritance')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: true, value: 'blue' }, }); }); @@ -107,12 +109,12 @@ it('prioritizes different kinds of styles', () => { const stylesheet = collectStylesheet(root); expect( computeStyle(stylesheet, getElementById(root, 'complex-selector')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'red' }, }); expect( computeStyle(stylesheet, getElementById(root, 'override-selector')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'blue' }, }); expect( @@ -120,12 +122,12 @@ it('prioritizes different kinds of styles', () => { stylesheet, getElementById(root, 'attribute-over-inheritance'), ), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'orange' }, }); expect( computeStyle(stylesheet, getElementById(root, 'style-rule-over-attribute')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'blue' }, }); expect( @@ -133,7 +135,7 @@ it('prioritizes different kinds of styles', () => { stylesheet, getElementById(root, 'inline-style-over-style-rule'), ), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'purple' }, }); }); @@ -153,7 +155,7 @@ it('prioritizes important styles', () => { const stylesheet = collectStylesheet(root); expect( computeStyle(stylesheet, getElementById(root, 'complex-selector')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'green' }, }); expect( @@ -161,7 +163,7 @@ it('prioritizes important styles', () => { stylesheet, getElementById(root, 'style-rule-over-inline-style'), ), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'green' }, }); expect( @@ -169,7 +171,7 @@ it('prioritizes important styles', () => { stylesheet, getElementById(root, 'inline-style-over-style-rule'), ), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'purple' }, }); }); @@ -195,23 +197,29 @@ it('treats at-rules and pseudo-classes as dynamic styles', () => { `); const stylesheet = collectStylesheet(root); - expect(computeStyle(stylesheet, getElementById(root, 'media-query'))).toEqual( + expect( + computeStyle(stylesheet, getElementById(root, 'media-query')), + ).toStrictEqual({ + fill: { type: 'dynamic', inherited: false }, + }); + expect(computeStyle(stylesheet, getElementById(root, 'hover'))).toStrictEqual( { fill: { type: 'dynamic', inherited: false }, }, ); - expect(computeStyle(stylesheet, getElementById(root, 'hover'))).toEqual({ - fill: { type: 'dynamic', inherited: false }, - }); - expect(computeStyle(stylesheet, getElementById(root, 'inherited'))).toEqual({ + expect( + computeStyle(stylesheet, getElementById(root, 'inherited')), + ).toStrictEqual({ fill: { type: 'dynamic', inherited: true }, }); expect( computeStyle(stylesheet, getElementById(root, 'inherited-overriden')), - ).toEqual({ + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'blue' }, }); - expect(computeStyle(stylesheet, getElementById(root, 'static'))).toEqual({ + expect( + computeStyle(stylesheet, getElementById(root, 'static')), + ).toStrictEqual({ fill: { type: 'static', inherited: false, value: 'black' }, }); }); @@ -234,17 +242,19 @@ it('considers - - + + diff --git a/test/plugins/prefixIds.02.svg b/test/plugins/prefixIds.02.svg.txt similarity index 78% rename from test/plugins/prefixIds.02.svg rename to test/plugins/prefixIds.02.svg.txt index fe22dad7e..9b83f6560 100644 --- a/test/plugins/prefixIds.02.svg +++ b/test/plugins/prefixIds.02.svg.txt @@ -12,10 +12,10 @@ - + - + diff --git a/test/plugins/prefixIds.03.svg b/test/plugins/prefixIds.03.svg.txt similarity index 80% rename from test/plugins/prefixIds.03.svg rename to test/plugins/prefixIds.03.svg.txt index b87b25ece..655672ae1 100644 --- a/test/plugins/prefixIds.03.svg +++ b/test/plugins/prefixIds.03.svg.txt @@ -5,5 +5,5 @@ @@@ - + diff --git a/test/plugins/prefixIds.04.svg b/test/plugins/prefixIds.04.svg.txt similarity index 94% rename from test/plugins/prefixIds.04.svg rename to test/plugins/prefixIds.04.svg.txt index d3d475597..b8f18c023 100644 --- a/test/plugins/prefixIds.04.svg +++ b/test/plugins/prefixIds.04.svg.txt @@ -15,7 +15,7 @@ diff --git a/test/plugins/prefixIds.05.svg b/test/plugins/prefixIds.05.svg.txt similarity index 73% rename from test/plugins/prefixIds.05.svg rename to test/plugins/prefixIds.05.svg.txt index d7805dd5d..8e263e09a 100644 --- a/test/plugins/prefixIds.05.svg +++ b/test/plugins/prefixIds.05.svg.txt @@ -22,20 +22,20 @@ - + - + - + - - - + + + diff --git a/test/plugins/prefixIds.06.svg b/test/plugins/prefixIds.06.svg.txt similarity index 51% rename from test/plugins/prefixIds.06.svg rename to test/plugins/prefixIds.06.svg.txt index 9bd4f7643..5b93b949a 100644 --- a/test/plugins/prefixIds.06.svg +++ b/test/plugins/prefixIds.06.svg.txt @@ -29,10 +29,10 @@ - - - - + + + + diff --git a/test/plugins/prefixIds.07.svg b/test/plugins/prefixIds.07.svg.txt similarity index 78% rename from test/plugins/prefixIds.07.svg rename to test/plugins/prefixIds.07.svg.txt index add8a8d18..00903c3c6 100644 --- a/test/plugins/prefixIds.07.svg +++ b/test/plugins/prefixIds.07.svg.txt @@ -16,9 +16,9 @@ - + diff --git a/test/plugins/prefixIds.08.svg b/test/plugins/prefixIds.08.svg.txt similarity index 77% rename from test/plugins/prefixIds.08.svg rename to test/plugins/prefixIds.08.svg.txt index 1008b6cd2..74d7b0078 100644 --- a/test/plugins/prefixIds.08.svg +++ b/test/plugins/prefixIds.08.svg.txt @@ -16,10 +16,10 @@ - + @@@ diff --git a/test/plugins/prefixIds.09.svg b/test/plugins/prefixIds.09.svg.txt similarity index 100% rename from test/plugins/prefixIds.09.svg rename to test/plugins/prefixIds.09.svg.txt diff --git a/test/plugins/prefixIds.10.svg b/test/plugins/prefixIds.10.svg.txt similarity index 53% rename from test/plugins/prefixIds.10.svg rename to test/plugins/prefixIds.10.svg.txt index 7b4ce3188..f9a9ffe9d 100644 --- a/test/plugins/prefixIds.10.svg +++ b/test/plugins/prefixIds.10.svg.txt @@ -8,8 +8,8 @@ @@@ - - - + + + diff --git a/test/plugins/prefixIds.11.svg b/test/plugins/prefixIds.11.svg.txt similarity index 63% rename from test/plugins/prefixIds.11.svg rename to test/plugins/prefixIds.11.svg.txt index aad0aabde..3c6bf3821 100644 --- a/test/plugins/prefixIds.11.svg +++ b/test/plugins/prefixIds.11.svg.txt @@ -14,8 +14,8 @@ prefixIds should correctly handle url()s in style attribute, including multiple - - + + - + diff --git a/test/plugins/prefixIds.12.svg b/test/plugins/prefixIds.12.svg.txt similarity index 90% rename from test/plugins/prefixIds.12.svg rename to test/plugins/prefixIds.12.svg.txt index fb38f1f6d..e1886858a 100644 --- a/test/plugins/prefixIds.12.svg +++ b/test/plugins/prefixIds.12.svg.txt @@ -15,6 +15,6 @@ into multiple nodes due to XML comments. diff --git a/test/plugins/prefixIds.test.js b/test/plugins/prefixIds.test.js index 97f1a8fd1..96c744049 100644 --- a/test/plugins/prefixIds.test.js +++ b/test/plugins/prefixIds.test.js @@ -1,6 +1,4 @@ -'use strict'; - -const { optimize } = require('../../lib/svgo.js'); +import { optimize } from '../../lib/svgo.js'; test('should extract prefix from path basename', () => { const svg = ``; @@ -8,17 +6,17 @@ test('should extract prefix from path basename', () => { optimize(svg, { plugins: ['prefixIds'], }).data, - ).toEqual(``); + ).toBe(``); expect( optimize(svg, { plugins: ['prefixIds'], path: 'input.svg', }).data, - ).toEqual(``); + ).toBe(``); expect( optimize(svg, { plugins: ['prefixIds'], path: 'path/to/input.svg', }).data, - ).toEqual(``); + ).toBe(``); }); diff --git a/test/plugins/removeAttributesBySelector.01.svg b/test/plugins/removeAttributesBySelector.01.svg.txt similarity index 100% rename from test/plugins/removeAttributesBySelector.01.svg rename to test/plugins/removeAttributesBySelector.01.svg.txt diff --git a/test/plugins/removeAttributesBySelector.02.svg b/test/plugins/removeAttributesBySelector.02.svg.txt similarity index 100% rename from test/plugins/removeAttributesBySelector.02.svg rename to test/plugins/removeAttributesBySelector.02.svg.txt diff --git a/test/plugins/removeAttributesBySelector.03.svg b/test/plugins/removeAttributesBySelector.03.svg.txt similarity index 100% rename from test/plugins/removeAttributesBySelector.03.svg rename to test/plugins/removeAttributesBySelector.03.svg.txt diff --git a/test/plugins/removeAttrs.01.svg b/test/plugins/removeAttrs.01.svg.txt similarity index 100% rename from test/plugins/removeAttrs.01.svg rename to test/plugins/removeAttrs.01.svg.txt diff --git a/test/plugins/removeAttrs.02.svg b/test/plugins/removeAttrs.02.svg.txt similarity index 100% rename from test/plugins/removeAttrs.02.svg rename to test/plugins/removeAttrs.02.svg.txt diff --git a/test/plugins/removeAttrs.03.svg b/test/plugins/removeAttrs.03.svg.txt similarity index 100% rename from test/plugins/removeAttrs.03.svg rename to test/plugins/removeAttrs.03.svg.txt diff --git a/test/plugins/removeAttrs.04.svg b/test/plugins/removeAttrs.04.svg.txt similarity index 100% rename from test/plugins/removeAttrs.04.svg rename to test/plugins/removeAttrs.04.svg.txt diff --git a/test/plugins/removeAttrs.05.svg b/test/plugins/removeAttrs.05.svg.txt similarity index 100% rename from test/plugins/removeAttrs.05.svg rename to test/plugins/removeAttrs.05.svg.txt diff --git a/test/plugins/removeAttrs.06.svg b/test/plugins/removeAttrs.06.svg.txt similarity index 100% rename from test/plugins/removeAttrs.06.svg rename to test/plugins/removeAttrs.06.svg.txt diff --git a/test/plugins/removeComments.01.svg b/test/plugins/removeComments.01.svg.txt similarity index 100% rename from test/plugins/removeComments.01.svg rename to test/plugins/removeComments.01.svg.txt diff --git a/test/plugins/removeComments.02.svg b/test/plugins/removeComments.02.svg.txt similarity index 100% rename from test/plugins/removeComments.02.svg rename to test/plugins/removeComments.02.svg.txt diff --git a/test/plugins/removeComments.03.svg b/test/plugins/removeComments.03.svg.txt similarity index 100% rename from test/plugins/removeComments.03.svg rename to test/plugins/removeComments.03.svg.txt diff --git a/test/plugins/removeDesc.01.svg b/test/plugins/removeDesc.01.svg.txt similarity index 100% rename from test/plugins/removeDesc.01.svg rename to test/plugins/removeDesc.01.svg.txt diff --git a/test/plugins/removeDimensions.01.svg b/test/plugins/removeDimensions.01.svg.txt similarity index 100% rename from test/plugins/removeDimensions.01.svg rename to test/plugins/removeDimensions.01.svg.txt diff --git a/test/plugins/removeDimensions.02.svg b/test/plugins/removeDimensions.02.svg.txt similarity index 100% rename from test/plugins/removeDimensions.02.svg rename to test/plugins/removeDimensions.02.svg.txt diff --git a/test/plugins/removeDimensions.03.svg b/test/plugins/removeDimensions.03.svg.txt similarity index 100% rename from test/plugins/removeDimensions.03.svg rename to test/plugins/removeDimensions.03.svg.txt diff --git a/test/plugins/removeDimensions.04.svg b/test/plugins/removeDimensions.04.svg.txt similarity index 100% rename from test/plugins/removeDimensions.04.svg rename to test/plugins/removeDimensions.04.svg.txt diff --git a/test/plugins/removeDimensions.05.svg b/test/plugins/removeDimensions.05.svg.txt similarity index 100% rename from test/plugins/removeDimensions.05.svg rename to test/plugins/removeDimensions.05.svg.txt diff --git a/test/plugins/removeDoctype.01.svg b/test/plugins/removeDoctype.01.svg.txt similarity index 100% rename from test/plugins/removeDoctype.01.svg rename to test/plugins/removeDoctype.01.svg.txt diff --git a/test/plugins/removeEditorsNSData.01.svg b/test/plugins/removeEditorsNSData.01.svg.txt similarity index 100% rename from test/plugins/removeEditorsNSData.01.svg rename to test/plugins/removeEditorsNSData.01.svg.txt diff --git a/test/plugins/removeEditorsNSData.02.svg b/test/plugins/removeEditorsNSData.02.svg.txt similarity index 100% rename from test/plugins/removeEditorsNSData.02.svg rename to test/plugins/removeEditorsNSData.02.svg.txt diff --git a/test/plugins/removeElementsByAttr.01.svg b/test/plugins/removeElementsByAttr.01.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.01.svg rename to test/plugins/removeElementsByAttr.01.svg.txt diff --git a/test/plugins/removeElementsByAttr.02.svg b/test/plugins/removeElementsByAttr.02.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.02.svg rename to test/plugins/removeElementsByAttr.02.svg.txt diff --git a/test/plugins/removeElementsByAttr.03.svg b/test/plugins/removeElementsByAttr.03.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.03.svg rename to test/plugins/removeElementsByAttr.03.svg.txt diff --git a/test/plugins/removeElementsByAttr.04.svg b/test/plugins/removeElementsByAttr.04.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.04.svg rename to test/plugins/removeElementsByAttr.04.svg.txt diff --git a/test/plugins/removeElementsByAttr.05.svg b/test/plugins/removeElementsByAttr.05.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.05.svg rename to test/plugins/removeElementsByAttr.05.svg.txt diff --git a/test/plugins/removeElementsByAttr.06.svg b/test/plugins/removeElementsByAttr.06.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.06.svg rename to test/plugins/removeElementsByAttr.06.svg.txt diff --git a/test/plugins/removeElementsByAttr.07.svg b/test/plugins/removeElementsByAttr.07.svg.txt similarity index 100% rename from test/plugins/removeElementsByAttr.07.svg rename to test/plugins/removeElementsByAttr.07.svg.txt diff --git a/test/plugins/removeEmptyAttrs.01.svg b/test/plugins/removeEmptyAttrs.01.svg.txt similarity index 100% rename from test/plugins/removeEmptyAttrs.01.svg rename to test/plugins/removeEmptyAttrs.01.svg.txt diff --git a/test/plugins/removeEmptyAttrs.02.svg b/test/plugins/removeEmptyAttrs.02.svg.txt similarity index 100% rename from test/plugins/removeEmptyAttrs.02.svg rename to test/plugins/removeEmptyAttrs.02.svg.txt diff --git a/test/plugins/removeEmptyContainers.01.svg b/test/plugins/removeEmptyContainers.01.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.01.svg rename to test/plugins/removeEmptyContainers.01.svg.txt diff --git a/test/plugins/removeEmptyContainers.02.svg b/test/plugins/removeEmptyContainers.02.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.02.svg rename to test/plugins/removeEmptyContainers.02.svg.txt diff --git a/test/plugins/removeEmptyContainers.03.svg b/test/plugins/removeEmptyContainers.03.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.03.svg rename to test/plugins/removeEmptyContainers.03.svg.txt diff --git a/test/plugins/removeEmptyContainers.04.svg b/test/plugins/removeEmptyContainers.04.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.04.svg rename to test/plugins/removeEmptyContainers.04.svg.txt diff --git a/test/plugins/removeEmptyContainers.05.svg b/test/plugins/removeEmptyContainers.05.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.05.svg rename to test/plugins/removeEmptyContainers.05.svg.txt diff --git a/test/plugins/removeEmptyContainers.06.svg b/test/plugins/removeEmptyContainers.06.svg.txt similarity index 100% rename from test/plugins/removeEmptyContainers.06.svg rename to test/plugins/removeEmptyContainers.06.svg.txt diff --git a/test/plugins/removeEmptyText.01.svg b/test/plugins/removeEmptyText.01.svg.txt similarity index 100% rename from test/plugins/removeEmptyText.01.svg rename to test/plugins/removeEmptyText.01.svg.txt diff --git a/test/plugins/removeEmptyText.02.svg b/test/plugins/removeEmptyText.02.svg.txt similarity index 100% rename from test/plugins/removeEmptyText.02.svg rename to test/plugins/removeEmptyText.02.svg.txt diff --git a/test/plugins/removeEmptyText.03.svg b/test/plugins/removeEmptyText.03.svg.txt similarity index 100% rename from test/plugins/removeEmptyText.03.svg rename to test/plugins/removeEmptyText.03.svg.txt diff --git a/test/plugins/removeHiddenElems.01.svg b/test/plugins/removeHiddenElems.01.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.01.svg rename to test/plugins/removeHiddenElems.01.svg.txt diff --git a/test/plugins/removeHiddenElems.02.svg b/test/plugins/removeHiddenElems.02.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.02.svg rename to test/plugins/removeHiddenElems.02.svg.txt diff --git a/test/plugins/removeHiddenElems.03.svg b/test/plugins/removeHiddenElems.03.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.03.svg rename to test/plugins/removeHiddenElems.03.svg.txt diff --git a/test/plugins/removeHiddenElems.04.svg b/test/plugins/removeHiddenElems.04.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.04.svg rename to test/plugins/removeHiddenElems.04.svg.txt diff --git a/test/plugins/removeHiddenElems.05.svg b/test/plugins/removeHiddenElems.05.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.05.svg rename to test/plugins/removeHiddenElems.05.svg.txt diff --git a/test/plugins/removeHiddenElems.06.svg b/test/plugins/removeHiddenElems.06.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.06.svg rename to test/plugins/removeHiddenElems.06.svg.txt diff --git a/test/plugins/removeHiddenElems.07.svg b/test/plugins/removeHiddenElems.07.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.07.svg rename to test/plugins/removeHiddenElems.07.svg.txt diff --git a/test/plugins/removeHiddenElems.08.svg b/test/plugins/removeHiddenElems.08.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.08.svg rename to test/plugins/removeHiddenElems.08.svg.txt diff --git a/test/plugins/removeHiddenElems.09.svg b/test/plugins/removeHiddenElems.09.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.09.svg rename to test/plugins/removeHiddenElems.09.svg.txt diff --git a/test/plugins/removeHiddenElems.10.svg b/test/plugins/removeHiddenElems.10.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.10.svg rename to test/plugins/removeHiddenElems.10.svg.txt diff --git a/test/plugins/removeHiddenElems.11.svg b/test/plugins/removeHiddenElems.11.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.11.svg rename to test/plugins/removeHiddenElems.11.svg.txt diff --git a/test/plugins/removeHiddenElems.12.svg b/test/plugins/removeHiddenElems.12.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.12.svg rename to test/plugins/removeHiddenElems.12.svg.txt diff --git a/test/plugins/removeHiddenElems.13.svg b/test/plugins/removeHiddenElems.13.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.13.svg rename to test/plugins/removeHiddenElems.13.svg.txt diff --git a/test/plugins/removeHiddenElems.14.svg b/test/plugins/removeHiddenElems.14.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.14.svg rename to test/plugins/removeHiddenElems.14.svg.txt diff --git a/test/plugins/removeHiddenElems.15.svg b/test/plugins/removeHiddenElems.15.svg.txt similarity index 100% rename from test/plugins/removeHiddenElems.15.svg rename to test/plugins/removeHiddenElems.15.svg.txt diff --git a/test/plugins/removeMetadata.01.svg b/test/plugins/removeMetadata.01.svg.txt similarity index 100% rename from test/plugins/removeMetadata.01.svg rename to test/plugins/removeMetadata.01.svg.txt diff --git a/test/plugins/removeNonInheritableGroupAttrs.01.svg b/test/plugins/removeNonInheritableGroupAttrs.01.svg.txt similarity index 100% rename from test/plugins/removeNonInheritableGroupAttrs.01.svg rename to test/plugins/removeNonInheritableGroupAttrs.01.svg.txt diff --git a/test/plugins/removeNonInheritableGroupAttrs.02.svg b/test/plugins/removeNonInheritableGroupAttrs.02.svg.txt similarity index 100% rename from test/plugins/removeNonInheritableGroupAttrs.02.svg rename to test/plugins/removeNonInheritableGroupAttrs.02.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.01.svg b/test/plugins/removeOffCanvasPaths.01.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.01.svg rename to test/plugins/removeOffCanvasPaths.01.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.02.svg b/test/plugins/removeOffCanvasPaths.02.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.02.svg rename to test/plugins/removeOffCanvasPaths.02.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.03.svg b/test/plugins/removeOffCanvasPaths.03.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.03.svg rename to test/plugins/removeOffCanvasPaths.03.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.04.svg b/test/plugins/removeOffCanvasPaths.04.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.04.svg rename to test/plugins/removeOffCanvasPaths.04.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.05.svg b/test/plugins/removeOffCanvasPaths.05.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.05.svg rename to test/plugins/removeOffCanvasPaths.05.svg.txt diff --git a/test/plugins/removeOffCanvasPaths.06.svg b/test/plugins/removeOffCanvasPaths.06.svg.txt similarity index 100% rename from test/plugins/removeOffCanvasPaths.06.svg rename to test/plugins/removeOffCanvasPaths.06.svg.txt diff --git a/test/plugins/removeRasterImages.01.svg b/test/plugins/removeRasterImages.01.svg.txt similarity index 100% rename from test/plugins/removeRasterImages.01.svg rename to test/plugins/removeRasterImages.01.svg.txt diff --git a/test/plugins/removeRasterImages.02.svg b/test/plugins/removeRasterImages.02.svg.txt similarity index 100% rename from test/plugins/removeRasterImages.02.svg rename to test/plugins/removeRasterImages.02.svg.txt diff --git a/test/plugins/removeScriptElement.01.svg b/test/plugins/removeScriptElement.01.svg.txt similarity index 100% rename from test/plugins/removeScriptElement.01.svg rename to test/plugins/removeScriptElement.01.svg.txt diff --git a/test/plugins/removeScriptElement.02.svg b/test/plugins/removeScriptElement.02.svg.txt similarity index 100% rename from test/plugins/removeScriptElement.02.svg rename to test/plugins/removeScriptElement.02.svg.txt diff --git a/test/plugins/removeScriptElement.03.svg b/test/plugins/removeScriptElement.03.svg.txt similarity index 100% rename from test/plugins/removeScriptElement.03.svg rename to test/plugins/removeScriptElement.03.svg.txt diff --git a/test/plugins/removeScriptElement.04.svg b/test/plugins/removeScriptElement.04.svg.txt similarity index 100% rename from test/plugins/removeScriptElement.04.svg rename to test/plugins/removeScriptElement.04.svg.txt diff --git a/test/plugins/removeScriptElement.05.svg b/test/plugins/removeScriptElement.05.svg.txt similarity index 100% rename from test/plugins/removeScriptElement.05.svg rename to test/plugins/removeScriptElement.05.svg.txt diff --git a/test/plugins/removeStyleElement.01.svg b/test/plugins/removeStyleElement.01.svg.txt similarity index 100% rename from test/plugins/removeStyleElement.01.svg rename to test/plugins/removeStyleElement.01.svg.txt diff --git a/test/plugins/removeTitle.01.svg b/test/plugins/removeTitle.01.svg.txt similarity index 100% rename from test/plugins/removeTitle.01.svg rename to test/plugins/removeTitle.01.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.01.svg b/test/plugins/removeUnknownsAndDefaults.01.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.01.svg rename to test/plugins/removeUnknownsAndDefaults.01.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.02.svg b/test/plugins/removeUnknownsAndDefaults.02.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.02.svg rename to test/plugins/removeUnknownsAndDefaults.02.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.03.svg b/test/plugins/removeUnknownsAndDefaults.03.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.03.svg rename to test/plugins/removeUnknownsAndDefaults.03.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.04.svg b/test/plugins/removeUnknownsAndDefaults.04.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.04.svg rename to test/plugins/removeUnknownsAndDefaults.04.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.05.svg b/test/plugins/removeUnknownsAndDefaults.05.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.05.svg rename to test/plugins/removeUnknownsAndDefaults.05.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.06.svg b/test/plugins/removeUnknownsAndDefaults.06.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.06.svg rename to test/plugins/removeUnknownsAndDefaults.06.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.07.svg b/test/plugins/removeUnknownsAndDefaults.07.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.07.svg rename to test/plugins/removeUnknownsAndDefaults.07.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.08.svg b/test/plugins/removeUnknownsAndDefaults.08.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.08.svg rename to test/plugins/removeUnknownsAndDefaults.08.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.09.svg b/test/plugins/removeUnknownsAndDefaults.09.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.09.svg rename to test/plugins/removeUnknownsAndDefaults.09.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.10.svg b/test/plugins/removeUnknownsAndDefaults.10.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.10.svg rename to test/plugins/removeUnknownsAndDefaults.10.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.11.svg b/test/plugins/removeUnknownsAndDefaults.11.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.11.svg rename to test/plugins/removeUnknownsAndDefaults.11.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.12.svg b/test/plugins/removeUnknownsAndDefaults.12.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.12.svg rename to test/plugins/removeUnknownsAndDefaults.12.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.13.svg b/test/plugins/removeUnknownsAndDefaults.13.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.13.svg rename to test/plugins/removeUnknownsAndDefaults.13.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.14.svg b/test/plugins/removeUnknownsAndDefaults.14.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.14.svg rename to test/plugins/removeUnknownsAndDefaults.14.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.15.svg b/test/plugins/removeUnknownsAndDefaults.15.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.15.svg rename to test/plugins/removeUnknownsAndDefaults.15.svg.txt diff --git a/test/plugins/removeUnknownsAndDefaults.16.svg b/test/plugins/removeUnknownsAndDefaults.16.svg.txt similarity index 100% rename from test/plugins/removeUnknownsAndDefaults.16.svg rename to test/plugins/removeUnknownsAndDefaults.16.svg.txt diff --git a/test/plugins/removeUnusedNS.01.svg b/test/plugins/removeUnusedNS.01.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.01.svg rename to test/plugins/removeUnusedNS.01.svg.txt diff --git a/test/plugins/removeUnusedNS.02.svg b/test/plugins/removeUnusedNS.02.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.02.svg rename to test/plugins/removeUnusedNS.02.svg.txt diff --git a/test/plugins/removeUnusedNS.03.svg b/test/plugins/removeUnusedNS.03.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.03.svg rename to test/plugins/removeUnusedNS.03.svg.txt diff --git a/test/plugins/removeUnusedNS.04.svg b/test/plugins/removeUnusedNS.04.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.04.svg rename to test/plugins/removeUnusedNS.04.svg.txt diff --git a/test/plugins/removeUnusedNS.05.svg b/test/plugins/removeUnusedNS.05.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.05.svg rename to test/plugins/removeUnusedNS.05.svg.txt diff --git a/test/plugins/removeUnusedNS.06.svg b/test/plugins/removeUnusedNS.06.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.06.svg rename to test/plugins/removeUnusedNS.06.svg.txt diff --git a/test/plugins/removeUnusedNS.07.svg b/test/plugins/removeUnusedNS.07.svg.txt similarity index 100% rename from test/plugins/removeUnusedNS.07.svg rename to test/plugins/removeUnusedNS.07.svg.txt diff --git a/test/plugins/removeUselessDefs.01.svg b/test/plugins/removeUselessDefs.01.svg.txt similarity index 100% rename from test/plugins/removeUselessDefs.01.svg rename to test/plugins/removeUselessDefs.01.svg.txt diff --git a/test/plugins/removeUselessDefs.02.svg b/test/plugins/removeUselessDefs.02.svg.txt similarity index 100% rename from test/plugins/removeUselessDefs.02.svg rename to test/plugins/removeUselessDefs.02.svg.txt diff --git a/test/plugins/removeUselessDefs.03.svg b/test/plugins/removeUselessDefs.03.svg.txt similarity index 100% rename from test/plugins/removeUselessDefs.03.svg rename to test/plugins/removeUselessDefs.03.svg.txt diff --git a/test/plugins/removeUselessDefs.04.svg.txt b/test/plugins/removeUselessDefs.04.svg.txt new file mode 100644 index 000000000..84e729072 --- /dev/null +++ b/test/plugins/removeUselessDefs.04.svg.txt @@ -0,0 +1,23 @@ +Don't remove non-rendering elements if children have IDs. + +=== + + + + + + + + + + +@@@ + + + + + + + + + \ No newline at end of file diff --git a/test/plugins/removeUselessDefs.05.svg.txt b/test/plugins/removeUselessDefs.05.svg.txt new file mode 100644 index 000000000..ef3557e0a --- /dev/null +++ b/test/plugins/removeUselessDefs.05.svg.txt @@ -0,0 +1,23 @@ +Don't remove used symbols. + +=== + + + + + + + + + + +@@@ + + + + + + + + + \ No newline at end of file diff --git a/test/plugins/removeUselessStrokeAndFill.01.svg b/test/plugins/removeUselessStrokeAndFill.01.svg.txt similarity index 100% rename from test/plugins/removeUselessStrokeAndFill.01.svg rename to test/plugins/removeUselessStrokeAndFill.01.svg.txt diff --git a/test/plugins/removeUselessStrokeAndFill.02.svg b/test/plugins/removeUselessStrokeAndFill.02.svg.txt similarity index 100% rename from test/plugins/removeUselessStrokeAndFill.02.svg rename to test/plugins/removeUselessStrokeAndFill.02.svg.txt diff --git a/test/plugins/removeUselessStrokeAndFill.03.svg b/test/plugins/removeUselessStrokeAndFill.03.svg.txt similarity index 100% rename from test/plugins/removeUselessStrokeAndFill.03.svg rename to test/plugins/removeUselessStrokeAndFill.03.svg.txt diff --git a/test/plugins/removeUselessStrokeAndFill.04.svg b/test/plugins/removeUselessStrokeAndFill.04.svg.txt similarity index 100% rename from test/plugins/removeUselessStrokeAndFill.04.svg rename to test/plugins/removeUselessStrokeAndFill.04.svg.txt diff --git a/test/plugins/removeUselessStrokeAndFill.05.svg b/test/plugins/removeUselessStrokeAndFill.05.svg.txt similarity index 100% rename from test/plugins/removeUselessStrokeAndFill.05.svg rename to test/plugins/removeUselessStrokeAndFill.05.svg.txt diff --git a/test/plugins/removeViewBox.01.svg b/test/plugins/removeViewBox.01.svg.txt similarity index 100% rename from test/plugins/removeViewBox.01.svg rename to test/plugins/removeViewBox.01.svg.txt diff --git a/test/plugins/removeViewBox.02.svg b/test/plugins/removeViewBox.02.svg.txt similarity index 100% rename from test/plugins/removeViewBox.02.svg rename to test/plugins/removeViewBox.02.svg.txt diff --git a/test/plugins/removeViewBox.03.svg b/test/plugins/removeViewBox.03.svg.txt similarity index 100% rename from test/plugins/removeViewBox.03.svg rename to test/plugins/removeViewBox.03.svg.txt diff --git a/test/plugins/removeViewBox.04.svg b/test/plugins/removeViewBox.04.svg.txt similarity index 100% rename from test/plugins/removeViewBox.04.svg rename to test/plugins/removeViewBox.04.svg.txt diff --git a/test/plugins/removeViewBox.05.svg b/test/plugins/removeViewBox.05.svg.txt similarity index 100% rename from test/plugins/removeViewBox.05.svg rename to test/plugins/removeViewBox.05.svg.txt diff --git a/test/plugins/removeXMLNS.01.svg b/test/plugins/removeXMLNS.01.svg.txt similarity index 100% rename from test/plugins/removeXMLNS.01.svg rename to test/plugins/removeXMLNS.01.svg.txt diff --git a/test/plugins/removeXMLProcInst.01.svg b/test/plugins/removeXMLProcInst.01.svg.txt similarity index 100% rename from test/plugins/removeXMLProcInst.01.svg rename to test/plugins/removeXMLProcInst.01.svg.txt diff --git a/test/plugins/removeXMLProcInst.02.svg b/test/plugins/removeXMLProcInst.02.svg.txt similarity index 100% rename from test/plugins/removeXMLProcInst.02.svg rename to test/plugins/removeXMLProcInst.02.svg.txt diff --git a/test/plugins/removeXlink.01.svg b/test/plugins/removeXlink.01.svg.txt similarity index 100% rename from test/plugins/removeXlink.01.svg rename to test/plugins/removeXlink.01.svg.txt diff --git a/test/plugins/removeXlink.02.svg b/test/plugins/removeXlink.02.svg.txt similarity index 100% rename from test/plugins/removeXlink.02.svg rename to test/plugins/removeXlink.02.svg.txt diff --git a/test/plugins/removeXlink.03.svg b/test/plugins/removeXlink.03.svg.txt similarity index 100% rename from test/plugins/removeXlink.03.svg rename to test/plugins/removeXlink.03.svg.txt diff --git a/test/plugins/removeXlink.04.svg b/test/plugins/removeXlink.04.svg.txt similarity index 100% rename from test/plugins/removeXlink.04.svg rename to test/plugins/removeXlink.04.svg.txt diff --git a/test/plugins/reusePaths.01.svg b/test/plugins/reusePaths.01.svg.txt similarity index 100% rename from test/plugins/reusePaths.01.svg rename to test/plugins/reusePaths.01.svg.txt diff --git a/test/plugins/reusePaths.02.svg b/test/plugins/reusePaths.02.svg.txt similarity index 100% rename from test/plugins/reusePaths.02.svg rename to test/plugins/reusePaths.02.svg.txt diff --git a/test/plugins/reusePaths.03.svg b/test/plugins/reusePaths.03.svg.txt similarity index 100% rename from test/plugins/reusePaths.03.svg rename to test/plugins/reusePaths.03.svg.txt diff --git a/test/plugins/reusePaths.04.svg b/test/plugins/reusePaths.04.svg.txt similarity index 100% rename from test/plugins/reusePaths.04.svg rename to test/plugins/reusePaths.04.svg.txt diff --git a/test/plugins/reusePaths.05.svg b/test/plugins/reusePaths.05.svg.txt similarity index 100% rename from test/plugins/reusePaths.05.svg rename to test/plugins/reusePaths.05.svg.txt diff --git a/test/plugins/reusePaths.06.svg b/test/plugins/reusePaths.06.svg.txt similarity index 100% rename from test/plugins/reusePaths.06.svg rename to test/plugins/reusePaths.06.svg.txt diff --git a/test/plugins/sortAttrs.01.svg b/test/plugins/sortAttrs.01.svg.txt similarity index 100% rename from test/plugins/sortAttrs.01.svg rename to test/plugins/sortAttrs.01.svg.txt diff --git a/test/plugins/sortAttrs.02.svg b/test/plugins/sortAttrs.02.svg.txt similarity index 100% rename from test/plugins/sortAttrs.02.svg rename to test/plugins/sortAttrs.02.svg.txt diff --git a/test/plugins/sortAttrs.03.svg b/test/plugins/sortAttrs.03.svg.txt similarity index 100% rename from test/plugins/sortAttrs.03.svg rename to test/plugins/sortAttrs.03.svg.txt diff --git a/test/plugins/sortAttrs.04.svg b/test/plugins/sortAttrs.04.svg.txt similarity index 100% rename from test/plugins/sortAttrs.04.svg rename to test/plugins/sortAttrs.04.svg.txt diff --git a/test/plugins/sortDefsChildren.01.svg b/test/plugins/sortDefsChildren.01.svg.txt similarity index 100% rename from test/plugins/sortDefsChildren.01.svg rename to test/plugins/sortDefsChildren.01.svg.txt diff --git a/test/regression-extract.js b/test/regression-extract.js index e5a594e65..8ac9898db 100644 --- a/test/regression-extract.js +++ b/test/regression-extract.js @@ -1,12 +1,13 @@ -'use strict'; +import fs from 'fs'; +import path from 'path'; +import stream from 'stream'; +import util from 'util'; +import zlib from 'zlib'; +import fetch from 'node-fetch'; +import tarStream from 'tar-stream'; +import { fileURLToPath } from 'url'; -const fs = require('fs'); -const path = require('path'); -const stream = require('stream'); -const util = require('util'); -const zlib = require('zlib'); -const { default: fetch } = require('node-fetch'); -const tarStream = require('tar-stream'); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const pipeline = util.promisify(stream.pipeline); diff --git a/test/regression.js b/test/regression.js index 6eed809a3..20592ee10 100644 --- a/test/regression.js +++ b/test/regression.js @@ -1,18 +1,19 @@ -'use strict'; - /** * @typedef {import('playwright').Page} Page * @typedef {import('playwright').PageScreenshotOptions} PageScreenshotOptions */ -const fs = require('node:fs/promises'); -const http = require('http'); -const os = require('os'); -const path = require('path'); -const pixelmatch = require('pixelmatch'); -const { chromium } = require('playwright'); -const { PNG } = require('pngjs'); -const { optimize } = require('../lib/svgo.js'); +import fs from 'node:fs/promises'; +import http from 'http'; +import os from 'os'; +import path from 'path'; +import pixelmatch from 'pixelmatch'; +import { chromium } from 'playwright'; +import { PNG } from 'pngjs'; +import { fileURLToPath } from 'url'; +import { optimize } from '../lib/svgo.js'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const width = 960; const height = 720; diff --git a/test/svg2js/_index.test.js b/test/svg2js/_index.test.js index 77c9075fd..fee646e6d 100644 --- a/test/svg2js/_index.test.js +++ b/test/svg2js/_index.test.js @@ -1,8 +1,9 @@ -'use strict'; +import FS from 'fs'; +import PATH from 'path'; +import { fileURLToPath } from 'url'; +import { parseSvg } from '../../lib/parser.js'; -const FS = require('fs'); -const PATH = require('path'); -const { parseSvg } = require('../../lib/parser.js'); +const __dirname = PATH.dirname(fileURLToPath(import.meta.url)); describe('svg2js', function () { describe('working svg', function () { @@ -22,7 +23,7 @@ describe('svg2js', function () { describe('root', function () { it('should exist', function () { - expect(root).toEqual(expect.anything()); + expect(root).toStrictEqual(expect.anything()); }); it('should be an instance of Object', function () { @@ -45,7 +46,7 @@ describe('svg2js', function () { }); it('the first node should be instruction', () => { - expect(root.children[0]).toEqual({ + expect(root.children[0]).toStrictEqual({ type: 'instruction', name: 'xml', value: 'version="1.0" encoding="utf-8"', @@ -53,7 +54,7 @@ describe('svg2js', function () { }); it('the second node should be comment', () => { - expect(root.children[1]).toEqual({ + expect(root.children[1]).toStrictEqual({ type: 'comment', value: 'Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)', @@ -61,7 +62,7 @@ describe('svg2js', function () { }); it('the third node should be doctype', () => { - expect(root.children[2]).toEqual({ + expect(root.children[2]).toStrictEqual({ type: 'doctype', name: 'svg', data: { @@ -73,7 +74,7 @@ describe('svg2js', function () { describe('name', function () { it('should have property name: "svg"', function () { - expect(root.children[3]).toEqual( + expect(root.children[3]).toStrictEqual( expect.objectContaining({ name: 'svg', }), @@ -83,7 +84,7 @@ describe('svg2js', function () { describe('children', function () { it('should exist', function () { - expect(root.children[3].children).toEqual(expect.anything()); + expect(root.children[3].children).toStrictEqual(expect.anything()); }); it('should be an instance of Array', function () { @@ -98,7 +99,7 @@ describe('svg2js', function () { describe('text nodes', function () { it('should contain preserved whitespace', function () { const textNode = root.children[3].children[1].children[0].children[1]; - expect(textNode.children[0].value).toEqual(' test '); + expect(textNode.children[0].value).toBe(' test '); }); }); }); diff --git a/test/svgo.cjs b/test/svgo.cjs new file mode 100644 index 000000000..2e661a0bc --- /dev/null +++ b/test/svgo.cjs @@ -0,0 +1,33 @@ +const { optimize } = require('../dist/svgo-node.cjs'); +const assert = require('assert'); + +const fixture = ` + + + + + + +`; + +const expected = ` + + + + + + + +`; + +const runTest = () => { + const result = optimize(fixture, { + plugins: [], + js2svg: { pretty: true, indent: 2 }, + }); + const actual = result.data; + + assert.equal(actual, expected); +}; + +runTest(); diff --git a/test/svgo/_index.test.js b/test/svgo/_index.test.js index e855dc6bf..423b97f0f 100644 --- a/test/svgo/_index.test.js +++ b/test/svgo/_index.test.js @@ -1,9 +1,10 @@ -'use strict'; +import fs from 'fs'; +import path from 'path'; +import { EOL } from 'os'; +import { fileURLToPath } from 'url'; +import { optimize } from '../../lib/svgo.js'; -const fs = require('fs'); -const path = require('path'); -const { EOL } = require('os'); -const { optimize } = require('../../lib/svgo.js'); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const regEOL = new RegExp(EOL, 'g'); @@ -24,16 +25,16 @@ describe('svgo', () => { plugins: [], js2svg: { pretty: true, indent: 2 }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should handle plugins order properly', async () => { const [original, expected] = await parseFixture('plugins-order.svg'); const result = optimize(original, { path: 'input.svg' }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should handle empty svg tag', async () => { const result = optimize('', { path: 'input.svg' }); - expect(result.data).toEqual(''); + expect(result.data).toBe(''); }); it('should preserve style specificity over attributes', async () => { const [original, expected] = await parseFixture('style-specificity.svg'); @@ -41,7 +42,7 @@ describe('svgo', () => { path: 'input.svg', js2svg: { pretty: true }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should inline entities', async () => { const [original, expected] = await parseFixture('entities.svg'); @@ -50,7 +51,7 @@ describe('svgo', () => { plugins: [], js2svg: { pretty: true }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should preserve whitespaces between tspan tags', async () => { const [original, expected] = await parseFixture('whitespaces.svg'); @@ -58,7 +59,7 @@ describe('svgo', () => { path: 'input.svg', js2svg: { pretty: true }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should preserve "to" keyframe selector', async () => { const [original, expected] = await parseFixture('keyframe-selectors.svg'); @@ -66,14 +67,14 @@ describe('svgo', () => { path: 'input.svg', js2svg: { pretty: true }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should not trim whitespace at start and end of pre element', async () => { const [original, expected] = await parseFixture('pre-element.svg'); const result = optimize(original, { path: 'input.svg', }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); it('should not add whitespace in pre element', async () => { const [original, expected] = await parseFixture('pre-element-pretty.svg'); @@ -81,6 +82,6 @@ describe('svgo', () => { path: 'input.svg', js2svg: { pretty: true }, }); - expect(normalize(result.data)).toEqual(expected); + expect(normalize(result.data)).toStrictEqual(expected); }); }); diff --git a/tsconfig.json b/tsconfig.json index 5bc6f365d..658db4af2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "noEmit": true, - "module": "commonjs", + "module": "node16", "target": "es2018", "lib": ["es2018"], "allowJs": true, diff --git a/yarn.lock b/yarn.lock index e6b23d23c..212af8186 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,13 +22,13 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.22.13": - version: 7.22.13 - resolution: "@babel/code-frame@npm:7.22.13" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.22.13": + version: 7.23.5 + resolution: "@babel/code-frame@npm:7.23.5" dependencies: - "@babel/highlight": ^7.22.13 + "@babel/highlight": ^7.23.4 chalk: ^2.4.2 - checksum: 22e342c8077c8b77eeb11f554ecca2ba14153f707b85294fcf6070b6f6150aae88a7b7436dd88d8c9289970585f3fe5b9b941c5aa3aa26a6d5a8ef3f292da058 + checksum: d90981fdf56a2824a9b14d19a4c0e8db93633fd488c772624b4e83e0ceac6039a27cd298a247c3214faa952bf803ba23696172ae7e7235f3b97f43ba278c569a languageName: node linkType: hard @@ -196,14 +196,14 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.22.13": - version: 7.22.20 - resolution: "@babel/highlight@npm:7.22.20" +"@babel/highlight@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/highlight@npm:7.23.4" dependencies: "@babel/helper-validator-identifier": ^7.22.20 chalk: ^2.4.2 js-tokens: ^4.0.0 - checksum: 84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 + checksum: 643acecdc235f87d925979a979b539a5d7d1f31ae7db8d89047269082694122d11aa85351304c9c978ceeb6d250591ccadb06c366f358ccee08bb9c122476b89 languageName: node linkType: hard @@ -786,7 +786,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 @@ -850,49 +850,164 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-commonjs@npm:^22.0.2": - version: 22.0.2 - resolution: "@rollup/plugin-commonjs@npm:22.0.2" +"@rollup/plugin-commonjs@npm:^25.0.7": + version: 25.0.7 + resolution: "@rollup/plugin-commonjs@npm:25.0.7" dependencies: - "@rollup/pluginutils": ^3.1.0 + "@rollup/pluginutils": ^5.0.1 commondir: ^1.0.1 - estree-walker: ^2.0.1 - glob: ^7.1.6 - is-reference: ^1.2.1 - magic-string: ^0.25.7 - resolve: ^1.17.0 + estree-walker: ^2.0.2 + glob: ^8.0.3 + is-reference: 1.2.1 + magic-string: ^0.30.3 peerDependencies: - rollup: ^2.68.0 - checksum: 70098a4b91afe3f164f5d27cba65edf148c5ed146ee0e07a964b66940681553ac77391083114cdcf9427e7f2706bf0d61eab310b3a2caeab83b7452c0292fcae + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 052e11839a9edc556eda5dcc759ab816dcc57e9f0f905a1e6e14fff954eaa6b1e2d0d544f5bd18d863993c5eba43d8ac9c19d9bb53b1c3b1213f32cfc9d50b2e languageName: node linkType: hard -"@rollup/plugin-node-resolve@npm:^14.1.0": - version: 14.1.0 - resolution: "@rollup/plugin-node-resolve@npm:14.1.0" +"@rollup/plugin-node-resolve@npm:^15.2.3": + version: 15.2.3 + resolution: "@rollup/plugin-node-resolve@npm:15.2.3" dependencies: - "@rollup/pluginutils": ^3.1.0 - "@types/resolve": 1.17.1 + "@rollup/pluginutils": ^5.0.1 + "@types/resolve": 1.20.2 deepmerge: ^4.2.2 - is-builtin-module: ^3.1.0 + is-builtin-module: ^3.2.1 is-module: ^1.0.0 - resolve: ^1.19.0 + resolve: ^1.22.1 peerDependencies: - rollup: ^2.78.0 - checksum: 7c5bed3e5a511ee47172acd91da1a828383f7ef72d54d27d8050598ef9038df0f86a8559db455611e138e07b99d787fd7445b11f81129970d07104644576d80a + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 730f32c2f8fdddff07cf0fca86a5dac7c475605fb96930197a868c066e62eb6388c557545e4f7d99b7a283411754c9fbf98944ab086b6074e04fc1292e234aa8 languageName: node linkType: hard -"@rollup/pluginutils@npm:^3.1.0": - version: 3.1.0 - resolution: "@rollup/pluginutils@npm:3.1.0" +"@rollup/plugin-terser@npm:^0.4.4": + version: 0.4.4 + resolution: "@rollup/plugin-terser@npm:0.4.4" dependencies: - "@types/estree": 0.0.39 - estree-walker: ^1.0.1 - picomatch: ^2.2.2 + serialize-javascript: ^6.0.1 + smob: ^1.0.0 + terser: ^5.17.4 peerDependencies: - rollup: ^1.20.0||^2.0.0 - checksum: 8be16e27863c219edbb25a4e6ec2fe0e1e451d9e917b6a43cf2ae5bc025a6b8faaa40f82a6e53b66d0de37b58ff472c6c3d57a83037ae635041f8df959d6d9aa + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 5472f659fbb7034488df91eb01ecd2ddf6d2cf203d049aa486139225ad5566254c6ec24aad1f5d1167e35f480212ede5160df9cc80e149a28874f78ed6a7fd9a + languageName: node + linkType: hard + +"@rollup/pluginutils@npm:^5.0.1": + version: 5.1.0 + resolution: "@rollup/pluginutils@npm:5.1.0" + dependencies: + "@types/estree": ^1.0.0 + estree-walker: ^2.0.2 + picomatch: ^2.3.1 + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 3cc5a6d91452a6eabbfd1ae79b4dd1f1e809d2eecda6e175deb784e75b0911f47e9ecce73f8dd315d6a8b3f362582c91d3c0f66908b6ced69345b3cbe28f8ce8 + languageName: node + linkType: hard + +"@rollup/rollup-android-arm-eabi@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.2" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-android-arm64@npm:4.9.2" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-darwin-arm64@npm:4.9.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-darwin-x64@npm:4.9.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.9.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.9.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.9.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.9.2" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.9.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.9.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.9.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.9.2": + version: 4.9.2 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.9.2" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -992,10 +1107,10 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:0.0.39": - version: 0.0.39 - resolution: "@types/estree@npm:0.0.39" - checksum: 412fb5b9868f2c418126451821833414189b75cc6bf84361156feed733e3d92ec220b9d74a89e52722e03d5e241b2932732711b7497374a404fad49087adc248 +"@types/estree@npm:*, @types/estree@npm:^1.0.0": + version: 1.0.5 + resolution: "@types/estree@npm:1.0.5" + checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a languageName: node linkType: hard @@ -1050,12 +1165,10 @@ __metadata: languageName: node linkType: hard -"@types/resolve@npm:1.17.1": - version: 1.17.1 - resolution: "@types/resolve@npm:1.17.1" - dependencies: - "@types/node": "*" - checksum: dc6a6df507656004e242dcb02c784479deca516d5f4b58a1707e708022b269ae147e1da0521f3e8ad0d63638869d87e0adc023f0bd5454aa6f72ac66c7525cf5 +"@types/resolve@npm:1.20.2": + version: 1.20.2 + resolution: "@types/resolve@npm:1.20.2" + checksum: 61c2cad2499ffc8eab36e3b773945d337d848d3ac6b7b0a87c805ba814bc838ef2f262fc0f109bfd8d2e0898ff8bd80ad1025f9ff64f1f71d3d4294c9f14e5f6 languageName: node linkType: hard @@ -1368,6 +1481,15 @@ __metadata: languageName: node linkType: hard +"brace-expansion@npm:^2.0.1": + version: 2.0.1 + resolution: "brace-expansion@npm:2.0.1" + dependencies: + balanced-match: ^1.0.0 + checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + languageName: node + linkType: hard + "braces@npm:^3.0.1": version: 3.0.2 resolution: "braces@npm:3.0.2" @@ -2060,14 +2182,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^1.0.1": - version: 1.0.1 - resolution: "estree-walker@npm:1.0.1" - checksum: 7e70da539691f6db03a08e7ce94f394ce2eef4180e136d251af299d41f92fb2d28ebcd9a6e393e3728d7970aeb5358705ddf7209d52fbcb2dd4693f95dcf925f - languageName: node - linkType: hard - -"estree-walker@npm:^2.0.1": +"estree-walker@npm:^2.0.2": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc @@ -2267,10 +2382,10 @@ __metadata: languageName: node linkType: hard -"function-bind@npm:^1.1.1": - version: 1.1.1 - resolution: "function-bind@npm:1.1.1" - checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 languageName: node linkType: hard @@ -2336,17 +2451,30 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": - version: 7.2.0 - resolution: "glob@npm:7.2.0" +"glob@npm:^7.1.3, glob@npm:^7.1.4": + version: 7.2.3 + resolution: "glob@npm:7.2.3" dependencies: fs.realpath: ^1.0.0 inflight: ^1.0.4 inherits: 2 - minimatch: ^3.0.4 + minimatch: ^3.1.1 once: ^1.3.0 path-is-absolute: ^1.0.0 - checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + languageName: node + linkType: hard + +"glob@npm:^8.0.3": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^5.0.1 + once: ^1.3.0 + checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47 languageName: node linkType: hard @@ -2415,12 +2543,12 @@ __metadata: languageName: node linkType: hard -"has@npm:^1.0.3": - version: 1.0.3 - resolution: "has@npm:1.0.3" +"hasown@npm:^2.0.0": + version: 2.0.0 + resolution: "hasown@npm:2.0.0" dependencies: - function-bind: ^1.1.1 - checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 + function-bind: ^1.1.2 + checksum: 6151c75ca12554565098641c98a40f4cc86b85b0fd5b6fe92360967e4605a4f9610f7757260b4e8098dd1c2ce7f4b095f2006fe72a570e3b6d2d28de0298c176 languageName: node linkType: hard @@ -2565,21 +2693,21 @@ __metadata: languageName: node linkType: hard -"is-builtin-module@npm:^3.1.0": - version: 3.2.0 - resolution: "is-builtin-module@npm:3.2.0" +"is-builtin-module@npm:^3.2.1": + version: 3.2.1 + resolution: "is-builtin-module@npm:3.2.1" dependencies: builtin-modules: ^3.3.0 - checksum: 0315751b898feff0646511c896e88b608a755c5025d0ce9a3ad25783de50be870e47dafb838cebbb06fbb2a948b209ea55348eee267836c9dd40d3a11ec717d3 + checksum: e8f0ffc19a98240bda9c7ada84d846486365af88d14616e737d280d378695c8c448a621dcafc8332dbf0fcd0a17b0763b845400709963fa9151ddffece90ae88 languageName: node linkType: hard -"is-core-module@npm:^2.2.0": - version: 2.6.0 - resolution: "is-core-module@npm:2.6.0" +"is-core-module@npm:^2.13.0": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" dependencies: - has: ^1.0.3 - checksum: 183b3b96fed19822b13959876b0317e61fc2cb5ebcbc21639904c81f7ae328af57f8e18cc4750a9c4abebd686130c70d34a89521e57dbe002edfa4614507ce18 + hasown: ^2.0.0 + checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c languageName: node linkType: hard @@ -2664,7 +2792,7 @@ __metadata: languageName: node linkType: hard -"is-reference@npm:^1.2.1": +"is-reference@npm:1.2.1": version: 1.2.1 resolution: "is-reference@npm:1.2.1" dependencies: @@ -3167,17 +3295,6 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^26.2.1": - version: 26.6.2 - resolution: "jest-worker@npm:26.6.2" - dependencies: - "@types/node": "*" - merge-stream: ^2.0.0 - supports-color: ^7.0.0 - checksum: f9afa3b88e3f12027901e4964ba3ff048285b5783b5225cab28fac25b4058cea8ad54001e9a1577ee2bed125fac3ccf5c80dc507b120300cc1bbcb368796533e - languageName: node - linkType: hard - "jest-worker@npm:^29.7.0": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" @@ -3343,12 +3460,12 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.25.7": - version: 0.25.7 - resolution: "magic-string@npm:0.25.7" +"magic-string@npm:^0.30.3": + version: 0.30.5 + resolution: "magic-string@npm:0.30.5" dependencies: - sourcemap-codec: ^1.4.4 - checksum: 727a1fb70f9610304fe384f1df0251eb7d1d9dd779c07ef1225690361b71b216f26f5d934bfb11c919b5b0e7ba50f6240c823a6f2e44cfd33d4a07d7747ca829 + "@jridgewell/sourcemap-codec": ^1.4.15 + checksum: da10fecff0c0a7d3faf756913ce62bd6d5e7b0402be48c3b27bfd651b90e29677e279069a63b764bcdc1b8ecdcdb898f29a5c5ec510f2323e8d62ee057a6eb18 languageName: node linkType: hard @@ -3438,7 +3555,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -3447,6 +3564,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^5.0.1": + version: 5.1.6 + resolution: "minimatch@npm:5.1.6" + dependencies: + brace-expansion: ^2.0.1 + checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77 + languageName: node + linkType: hard + "minipass-collect@npm:^1.0.2": version: 1.0.2 resolution: "minipass-collect@npm:1.0.2" @@ -3783,7 +3909,7 @@ __metadata: languageName: node linkType: hard -"path-parse@npm:^1.0.6": +"path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" checksum: 49abf3d81115642938a8700ec580da6e830dde670be21893c62f4e10bd7dd4c3742ddc603fe24f898cba7eb0c6bc1777f8d9ac14185d34540c6d4d80cd9cae8a @@ -3804,10 +3930,10 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.2.2, picomatch@npm:^2.2.3": - version: 2.3.0 - resolution: "picomatch@npm:2.3.0" - checksum: 16818720ea7c5872b6af110760dee856c8e4cd79aed1c7a006d076b1cc09eff3ae41ca5019966694c33fbd2e1cc6ea617ab10e4adac6df06556168f13be3fca2 +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf languageName: node linkType: hard @@ -4033,23 +4159,29 @@ __metadata: languageName: node linkType: hard -"resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0": - version: 1.20.0 - resolution: "resolve@npm:1.20.0" +"resolve@^1.20.0, resolve@npm:^1.22.1": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" dependencies: - is-core-module: ^2.2.0 - path-parse: ^1.0.6 - checksum: 40cf70b2cde00ef57f99daf2dc63c6a56d6c14a1b7fc51735d06a6f0a3b97cb67b4fb7ef6c747b4e13a7baba83b0ef625d7c4ce92a483cd5af923c3b65fd16fe + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c languageName: node linkType: hard -"resolve@patch:resolve@^1.17.0#~builtin, resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin": - version: 1.20.0 - resolution: "resolve@patch:resolve@npm%3A1.20.0#~builtin::version=1.20.0&hash=07638b" +"resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=07638b" dependencies: - is-core-module: ^2.2.0 - path-parse: ^1.0.6 - checksum: a0dd7d16a8e47af23afa9386df2dff10e3e0debb2c7299a42e581d9d9b04d7ad5d2c53f24f1e043f7b3c250cbdc71150063e53d0b6559683d37f790b7c8c3cd5 + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 languageName: node linkType: hard @@ -4078,31 +4210,56 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-terser@npm:^7.0.2": - version: 7.0.2 - resolution: "rollup-plugin-terser@npm:7.0.2" - dependencies: - "@babel/code-frame": ^7.10.4 - jest-worker: ^26.2.1 - serialize-javascript: ^4.0.0 - terser: ^5.0.0 - peerDependencies: - rollup: ^2.0.0 - checksum: af84bb7a7a894cd00852b6486528dfb8653cf94df4c126f95f389a346f401d054b08c46bee519a2ab6a22b33804d1d6ac6d8c90b1b2bf8fffb097eed73fc3c72 - languageName: node - linkType: hard - -"rollup@npm:^2.79.1": - version: 2.79.1 - resolution: "rollup@npm:2.79.1" - dependencies: +"rollup@npm:^4.9.2": + version: 4.9.2 + resolution: "rollup@npm:4.9.2" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.9.2 + "@rollup/rollup-android-arm64": 4.9.2 + "@rollup/rollup-darwin-arm64": 4.9.2 + "@rollup/rollup-darwin-x64": 4.9.2 + "@rollup/rollup-linux-arm-gnueabihf": 4.9.2 + "@rollup/rollup-linux-arm64-gnu": 4.9.2 + "@rollup/rollup-linux-arm64-musl": 4.9.2 + "@rollup/rollup-linux-riscv64-gnu": 4.9.2 + "@rollup/rollup-linux-x64-gnu": 4.9.2 + "@rollup/rollup-linux-x64-musl": 4.9.2 + "@rollup/rollup-win32-arm64-msvc": 4.9.2 + "@rollup/rollup-win32-ia32-msvc": 4.9.2 + "@rollup/rollup-win32-x64-msvc": 4.9.2 fsevents: ~2.3.2 dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true fsevents: optional: true bin: rollup: dist/bin/rollup - checksum: 6a2bf167b3587d4df709b37d149ad0300692cc5deb510f89ac7bdc77c8738c9546ae3de9322b0968e1ed2b0e984571f5f55aae28fa7de4cfcb1bc5402a4e2be6 + checksum: 2e4cd90c8fa004b5ff1f4028e331bc627206c5719b45c71cab21578bf60704bc71da241c7dfffcc0aa58bcf380b926ca39a27d6e2482b5996740a6697971b26d languageName: node linkType: hard @@ -4156,12 +4313,12 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:^4.0.0": - version: 4.0.0 - resolution: "serialize-javascript@npm:4.0.0" +"serialize-javascript@npm:^6.0.1": + version: 6.0.1 + resolution: "serialize-javascript@npm:6.0.1" dependencies: randombytes: ^2.1.0 - checksum: 3273b3394b951671fcf388726e9577021870dfbf85e742a1183fb2e91273e6101bdccea81ff230724f6659a7ee4cef924b0ff9baca32b79d9384ec37caf07302 + checksum: 3c4f4cb61d0893b988415bdb67243637333f3f574e9e9cc9a006a2ced0b390b0b3b44aef8d51c951272a9002ec50885eefdc0298891bc27eb2fe7510ea87dc4f languageName: node linkType: hard @@ -4216,6 +4373,13 @@ __metadata: languageName: node linkType: hard +"smob@npm:^1.0.0": + version: 1.4.1 + resolution: "smob@npm:1.4.1" + checksum: 3bd9e6bcc440356b0e06165f04f0ea170ebc1d57713e4a1d64c57227cb423d8346d3e0894fd7ce28bf75958f73a62f91ba13574a9a0fb4cbc271fa9ef5d75f4e + languageName: node + linkType: hard + "socks-proxy-agent@npm:^5.0.0": version: 5.0.1 resolution: "socks-proxy-agent@npm:5.0.1" @@ -4271,13 +4435,6 @@ __metadata: languageName: node linkType: hard -"sourcemap-codec@npm:^1.4.4": - version: 1.4.8 - resolution: "sourcemap-codec@npm:1.4.8" - checksum: b57981c05611afef31605732b598ccf65124a9fcb03b833532659ac4d29ac0f7bfacbc0d6c5a28a03e84c7510e7e556d758d0bb57786e214660016fb94279316 - languageName: node - linkType: hard - "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -4421,7 +4578,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": +"supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -4439,12 +4596,20 @@ __metadata: languageName: node linkType: hard +"supports-preserve-symlinks-flag@npm:^1.0.0": + version: 1.0.0 + resolution: "supports-preserve-symlinks-flag@npm:1.0.0" + checksum: 53b1e247e68e05db7b3808b99b892bd36fb096e6fba213a06da7fab22045e97597db425c724f2bbd6c99a3c295e1e73f3e4de78592289f38431049e1277ca0ae + languageName: node + linkType: hard + "svgo@workspace:.": version: 0.0.0-use.local resolution: "svgo@workspace:." dependencies: - "@rollup/plugin-commonjs": ^22.0.2 - "@rollup/plugin-node-resolve": ^14.1.0 + "@rollup/plugin-commonjs": ^25.0.7 + "@rollup/plugin-node-resolve": ^15.2.3 + "@rollup/plugin-terser": ^0.4.4 "@trysound/sax": 0.2.0 "@types/css-tree": ^2.3.4 "@types/csso": ^5.0.4 @@ -4463,12 +4628,11 @@ __metadata: playwright: ^1.40.1 pngjs: ^7.0.0 prettier: ^3.1.1 - rollup: ^2.79.1 - rollup-plugin-terser: ^7.0.2 + rollup: ^4.9.2 tar-stream: ^3.1.6 typescript: ^5.3.3 bin: - svgo: ./bin/svgo + svgo: ./bin/svgo.js languageName: unknown linkType: soft @@ -4497,9 +4661,9 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.0.0": - version: 5.20.0 - resolution: "terser@npm:5.20.0" +"terser@npm:^5.17.4": + version: 5.26.0 + resolution: "terser@npm:5.26.0" dependencies: "@jridgewell/source-map": ^0.3.3 acorn: ^8.8.2 @@ -4507,7 +4671,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 251d1b62d7c651ace29f997cf336ff5d5f8e30c65c8698ab7b831764d9e012ab0640895cb609906fb939a5bdf5143d73b5781c5c8c67b9216c77ce92dafdc0bc + checksum: 02a9bb896f04df828025af8f0eced36c315d25d310b6c2418e7dad2bed19ddeb34a9cea9b34e7c24789830fa51e1b6a9be26679980987a9c817a7e6d9cd4154b languageName: node linkType: hard