Sha256: cd56cf7d7867d6faa44303b8cc9f8c730cc803ea128d627f051e1100b4eb21f8

Contents?: true

Size: 945 Bytes

Versions: 27

Compression:

Stored size: 945 Bytes

Contents

'use strict';

exports.type = 'perItem';

exports.active = true;

exports.description = 'removes non-inheritable group’s presentational attributes';

var inheritableAttrs = require('./_collections').inheritableAttrs,
    attrsGroups = require('./_collections').attrsGroups,
    applyGroups = require('./_collections').presentationNonInheritableGroupAttrs;

/**
 * Remove non-inheritable group's "presentation" attributes.
 *
 * @param {Object} item current iteration item
 * @return {Boolean} if false, item will be filtered out
 *
 * @author Kir Belevich
 */
exports.fn = function(item) {

    if (item.isElem('g')) {

        item.eachAttr(function(attr) {
            if (
                ~attrsGroups.presentation.indexOf(attr.name) &&
                !~inheritableAttrs.indexOf(attr.name) &&
                !~applyGroups.indexOf(attr.name)
            ) {
                item.removeAttr(attr.name);
            }
        });

    }

};

Version data entries

27 entries across 26 versions & 9 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.18.0 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.18.2 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.16.1 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.15.2 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.18.4 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.18.1 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.14.0 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
tang-0.2.1 spec/tang_app/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
tang-0.2.0 spec/tang_app/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
tang-0.1.0 spec/tang_app/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
tang-0.0.9 spec/tang_app/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
enju_library-0.3.8 spec/dummy/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
jester-data-8.0.0 node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js