From 275f9dc0bdf3e58aa36b800f55f8648fbc55d8af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 4 Jan 2024 11:07:54 +0800 Subject: upgrade --- node_modules/svgo/plugins/removeXlink.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'node_modules/svgo/plugins/removeXlink.js') diff --git a/node_modules/svgo/plugins/removeXlink.js b/node_modules/svgo/plugins/removeXlink.js index d341b673..0411cc14 100644 --- a/node_modules/svgo/plugins/removeXlink.js +++ b/node_modules/svgo/plugins/removeXlink.js @@ -28,17 +28,17 @@ const SHOW_TO_TARGET = { * Elements that use xlink:href, but were deprecated in SVG 2 and therefore * don't support the SVG 2 href attribute. * - * @type {string[]} + * @type {Set} * @see https://developer.mozilla.org/docs/Web/SVG/Attribute/xlink:href * @see https://developer.mozilla.org/docs/Web/SVG/Attribute/href */ -const LEGACY_ELEMENTS = [ +const LEGACY_ELEMENTS = new Set([ 'cursor', 'filter', 'font-face-uri', 'glyphRef', 'tref', -]; +]); /** * @param {XastElement} node @@ -136,7 +136,7 @@ exports.fn = (_, params) => { const attr = titleAttrs[i]; const value = node.attributes[attr]; const hasTitle = node.children.filter( - (child) => child.type === 'element' && child.name === 'title' + (child) => child.type === 'element' && child.name === 'title', ); if (hasTitle.length > 0) { @@ -170,7 +170,7 @@ exports.fn = (_, params) => { if ( hrefAttrs.length > 0 && - LEGACY_ELEMENTS.includes(node.name) && + LEGACY_ELEMENTS.has(node.name) && !includeLegacy ) { hrefAttrs -- cgit v1.2.3