diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-01-04 11:07:54 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-01-04 11:07:54 +0800 |
| commit | 275f9dc0bdf3e58aa36b800f55f8648fbc55d8af (patch) | |
| tree | 81c7cf120fb703cfd5e3162f2366033d9fe5c7f8 /node_modules/svgo/plugins/removeXlink.js | |
| parent | 2b4ab36917baef56c7ce1602966f941be15af785 (diff) | |
upgrade
Diffstat (limited to 'node_modules/svgo/plugins/removeXlink.js')
| -rw-r--r-- | node_modules/svgo/plugins/removeXlink.js | 10 |
1 files changed, 5 insertions, 5 deletions
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<string>} * @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 |
