Skip to content

Commit

Permalink
docs: Expand visit() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed May 6, 2023
1 parent b741332 commit 57f7bf5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/05_content_nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ The return value of the visitor may be used to control the traversal:
If `visitor` is a single function, it will be called with all values encountered in the tree, including e.g. `null` values.
Alternatively, separate visitor functions may be defined for each `Map`, `Pair`, `Seq`, `Alias` and `Scalar` node.
To define the same visitor function for more than one node type,
use the `Collection` (map and seq), `Value` (map, seq & scalar) and `Node` (alias, map, seq & scalar) targets.
Of all these, only the most specific defined one will be used for each node.
#### `YAML.visitAsync(node, visitor): Promise<void>`
Expand Down

0 comments on commit 57f7bf5

Please sign in to comment.