diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-12-21 22:46:53 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-12-21 22:46:53 +0800 |
| commit | f06956efd2dc4bf77244a9fcce2b883a00b925af (patch) | |
| tree | 0123cb73ce67f1f4b17e1d6cbabff076ee44e31b /node_modules/svgo/plugins/removeAttrs.js | |
| parent | 8d980c13970c15b6d2312b6fc4ac51698dd0d220 (diff) | |
updated node modules
Diffstat (limited to 'node_modules/svgo/plugins/removeAttrs.js')
| -rw-r--r-- | node_modules/svgo/plugins/removeAttrs.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/node_modules/svgo/plugins/removeAttrs.js b/node_modules/svgo/plugins/removeAttrs.js index c289d8ca..dc1224bd 100644 --- a/node_modules/svgo/plugins/removeAttrs.js +++ b/node_modules/svgo/plugins/removeAttrs.js @@ -104,13 +104,11 @@ exports.fn = (root, params) => { enter: (node) => { for (let pattern of attrs) { // if no element separators (:), assume it's attribute name, and apply to all elements *regardless of value* - if (pattern.includes(elemSeparator) === false) { - pattern = ['.*', elemSeparator, pattern, elemSeparator, '.*'].join( - '' - ); + if (!pattern.includes(elemSeparator)) { + pattern = ['.*', pattern, '.*'].join(elemSeparator); // if only 1 separator, assume it's element and attribute name, and apply regardless of attribute value } else if (pattern.split(elemSeparator).length < 3) { - pattern = [pattern, elemSeparator, '.*'].join(''); + pattern = [pattern, '.*'].join(elemSeparator); } // create regexps for element, attribute name, and attribute value |
