1
0
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:
Bogdan Chadkin
2021-08-27 17:01:29 +03:00
committed by GitHub
parent ac8edbaf41
commit 3ca57d1856
4 changed files with 121 additions and 100 deletions

View File

@ -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;
};