mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Add visitSkip symbol (#1547)
This should help to avoid node.parentNode and closestByName in some cases by skiping visiting children of current node. Works only in `enter` listener.
This commit is contained in:
@ -52,7 +52,7 @@ export type XastParent = XastRoot | XastElement;
|
||||
export type XastNode = XastRoot | XastChild;
|
||||
|
||||
type VisitorNode<Node> = {
|
||||
enter?: (node: Node, parentNode: XastParent) => void;
|
||||
enter?: (node: Node, parentNode: XastParent) => void | symbol;
|
||||
exit?: (node: Node, parentNode: XastParent) => void;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user