MCPcopy
hub / github.com/svg/svgo / removeElement

Function removeElement

plugins/removeHiddenElems.js:120–131  ·  view source on GitHub ↗

* @param {import('../lib/types.js').XastChild} node * @param {import('../lib/types.js').XastParent} parentNode

(node, parentNode)

Source from the content-addressed store, hash-verified

118 * @param {import('../lib/types.js').XastParent} parentNode
119 */
120 function removeElement(node, parentNode) {
121 if (
122 node.type === 'element' &&
123 node.attributes.id != null &&
124 parentNode.type === 'element' &&
125 parentNode.name === 'defs'
126 ) {
127 removedDefIds.add(node.attributes.id);
128 }
129
130 detachNodeFromParent(node, parentNode);
131 }
132
133 visit(root, {
134 element: {

Callers 1

fnFunction · 0.85

Calls 1

detachNodeFromParentFunction · 0.90

Tested by

no test coverage detected