Skip to content

Commit

Permalink
Merge pull request #81 from behinger/patch-1
Browse files Browse the repository at this point in the history
Fix typo & slightly improve docs on pre/postwalk
  • Loading branch information
DrChainsaw authored Aug 7, 2024
2 parents 3633f3b + 6a4b16d commit 4c2d69d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datastructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ postwalk(f, t::File; collect_children=identity) = f(t)
apply `f` to every node in the tree. To only visit File nodes, pass `dirs=false`.
walk can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
walk can be either `FileTrees.postwalk` or `FileTrees.prewalk`. Which applies the function after recursively walking the tree, or before.
"""
function Base.map(f, tree::FileTree; walk=postwalk, dirs=true)
walk(tree, collect_children=identity) do n
Expand All @@ -354,7 +354,7 @@ Return a copy of `tree`, removing nodes for which `f` is `false`.
The function `f` is passed all nodes (`File`s and `FileTree`s) if `dirs=true`
and leaf nodes (`File`s) if `dirs=false`.
`walk` can be either `FileTrees.postwalk` or `FileTrees.postwalk`.
`walk` can be either `FileTrees.postwalk` or `FileTrees.prewalk`. Which applies the function after recursively walking the tree, or before.
"""
function Base.filter(f, tree::FileTree; walk=prewalk, dirs=true)
walk(tree, collect_children=cs->filter(!isnothing, cs)) do n
Expand Down

0 comments on commit 4c2d69d

Please sign in to comment.