It appears you have a well-structured Git repository with various files, including SVG icons and HTML documents. Here's a brief overview:
This commit is contained in:
38
backend/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
generated
vendored
Normal file
38
backend/node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
inheritableAttrs,
|
||||
attrsGroups,
|
||||
presentationNonInheritableGroupAttrs,
|
||||
} = require('./_collections');
|
||||
|
||||
exports.name = 'removeNonInheritableGroupAttrs';
|
||||
exports.description =
|
||||
'removes non-inheritable group’s presentational attributes';
|
||||
|
||||
/**
|
||||
* Remove non-inheritable group's "presentation" attributes.
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*
|
||||
* @type {import('./plugins-types').Plugin<'removeNonInheritableGroupAttrs'>}
|
||||
*/
|
||||
exports.fn = () => {
|
||||
return {
|
||||
element: {
|
||||
enter: (node) => {
|
||||
if (node.name === 'g') {
|
||||
for (const name of Object.keys(node.attributes)) {
|
||||
if (
|
||||
attrsGroups.presentation.has(name) &&
|
||||
!inheritableAttrs.has(name) &&
|
||||
!presentationNonInheritableGroupAttrs.has(name)
|
||||
) {
|
||||
delete node.attributes[name];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user