Skip to content
Snippets Groups Projects
Commit 3285f8b3 authored by marihachi's avatar marihachi
Browse files

add inspect()

parent 28841ea9
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,15 @@ export function toString(node: MfmNode | MfmNode[]): string {
}
}
export function inspect(tree: MfmNode[], action: (node: MfmNode) => void): void {
for (const node of tree) {
action(node);
if (node.children != null) {
inspect(node.children, action);
}
}
}
export {
MfmNode,
MfmBlock,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment