source: frontend/node_modules/svgo/plugins/removeEmptyAttrs.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 509 bytes
Line 
1'use strict';
2
3exports.type = 'perItem';
4
5exports.active = true;
6
7exports.description = 'removes empty attributes';
8
9/**
10 * Remove attributes with empty values.
11 *
12 * @param {Object} item current iteration item
13 * @return {Boolean} if false, item will be filtered out
14 *
15 * @author Kir Belevich
16 */
17exports.fn = function(item) {
18
19 if (item.elem) {
20
21 item.eachAttr(function(attr) {
22 if (attr.value === '') {
23 item.removeAttr(attr.name);
24 }
25 });
26
27 }
28
29};
Note: See TracBrowser for help on using the repository browser.