1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-01 22:52:01 +02:00
This commit is contained in:
Jesse Duffield
2021-03-31 22:39:55 +11:00
parent 332a3c4cbf
commit 54910fdb76
9 changed files with 76 additions and 35 deletions

View File

@@ -77,6 +77,20 @@ func any(node INode, test func(INode) bool) bool {
return false
}
func every(node INode, test func(INode) bool) bool {
if !test(node) {
return false
}
for _, child := range node.GetChildren() {
if !every(child, test) {
return false
}
}
return true
}
func flatten(node INode, collapsedPaths map[string]bool) []INode {
result := []INode{}
result = append(result, node)