1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Access attributes directly (#1433)

Got rid from `.attrs`, `.attr()` and `.addAttr()` usages
This commit is contained in:
Bogdan Chadkin
2021-03-18 18:53:20 +03:00
committed by GitHub
parent 07928fc77e
commit 6f2f62c5ee
23 changed files with 261 additions and 283 deletions

View File

@ -30,7 +30,7 @@ exports.fn = function (item) {
(item.type === 'element' && item.children.length !== 0) ||
item.isElem('svg') ||
// empty patterns may contain reusable configuration
(item.isElem('pattern') && Object.keys(item.attrs).length !== 0) ||
(item.isElem('pattern') && Object.keys(item.attributes).length !== 0) ||
// The 'g' may not have content, but the filter may cause a rectangle
// to be created and filled with pattern.
(item.isElem('g') && item.hasAttr('filter')) ||