mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Remove hasAttr and hasAttrLocal usages (#1447)
In most cases simple check for null is enough.
This commit is contained in:
@ -58,9 +58,11 @@ const applyTransforms = (elem, pathData, params) => {
|
||||
let hasStrokeWidth = false;
|
||||
|
||||
do {
|
||||
if (idElem.hasAttr('stroke-width')) hasStrokeWidth = true;
|
||||
if (idElem.attributes['stroke-width']) {
|
||||
hasStrokeWidth = true;
|
||||
}
|
||||
} while (
|
||||
!idElem.hasAttr('id', id) &&
|
||||
idElem.attributes.id !== id &&
|
||||
!hasStrokeWidth &&
|
||||
(idElem = idElem.parentNode)
|
||||
);
|
||||
|
Reference in New Issue
Block a user