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/convertStyleToAttrs.js | |
| parent | 2b4ab36917baef56c7ce1602966f941be15af785 (diff) | |
upgrade
Diffstat (limited to 'node_modules/svgo/plugins/convertStyleToAttrs.js')
| -rw-r--r-- | node_modules/svgo/plugins/convertStyleToAttrs.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/node_modules/svgo/plugins/convertStyleToAttrs.js b/node_modules/svgo/plugins/convertStyleToAttrs.js index 662119e4..a9305fc4 100644 --- a/node_modules/svgo/plugins/convertStyleToAttrs.js +++ b/node_modules/svgo/plugins/convertStyleToAttrs.js @@ -31,7 +31,7 @@ const rValue = rSingleQuotes, rQuotes, rParenthesis, - '[^;]*?' + '[^;]*?', ) + '*?' + ')'; @@ -42,12 +42,12 @@ const rImportant = '(\\s*!important(?![-(\\w]))?'; // Final RegExp to parse CSS declarations. const regDeclarationBlock = new RegExp( rAttr + ':' + rValue + rImportant + rDeclEnd, - 'ig' + 'ig', ); // Comments expression. Honors escape sequences and strings. const regStripComments = new RegExp( g(rEscape, rSingleQuotes, rQuotes, '/\\*[^]*?\\*/'), - 'ig' + 'ig', ); /** @@ -87,13 +87,12 @@ exports.fn = (_root, params) => { return match[0] == '/' ? '' : match[0] == '\\' && /[-g-z]/i.test(match[1]) - ? match[1] - : match; - } + ? match[1] + : match; + }, ); regDeclarationBlock.lastIndex = 0; - // eslint-disable-next-line no-cond-assign for (var rule; (rule = regDeclarationBlock.exec(styleValue)); ) { if (!keepImportant || !rule[3]) { styles.push([rule[1], rule[2]]); @@ -110,7 +109,7 @@ exports.fn = (_root, params) => { val = val.slice(1, -1); } - if (stylingProps.includes(prop)) { + if (stylingProps.has(prop)) { newAttributes[prop] = val; return false; |
