1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Prepare root and element nodes for xast

Ref https://github.com/syntax-tree/xast

- added type: root | element
- renamed elem to name
- replaced "elem" property checks with check for correct type
This commit is contained in:
Bogdan Chadkin
2021-03-10 18:45:50 +03:00
parent 54daf72d50
commit e82a672bbf
29 changed files with 95 additions and 80 deletions

View File

@ -36,7 +36,7 @@ var regNumericValues = /^([-+]?\d*\.?\d+([eE][-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|
* @author Kir Belevich
*/
exports.fn = function (item, params) {
if (item.isElem()) {
if (item.type === 'element') {
var floatPrecision = params.floatPrecision;
if (item.hasAttr('viewBox')) {