MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / FilterChildren

Method FilterChildren

xmlparser/node.go:20–24  ·  view source on GitHub ↗

FilterChildren removes all child nodes that do not satisfy the given predicate function.

(pred func(child Token) bool)

Source from the content-addressed store, hash-verified

18
19// FilterChildren removes all child nodes that do not satisfy the given predicate function.
20func (n *Node) FilterChildren(pred func(child Token) bool) {
21 n.Children = slices.DeleteFunc(n.Children, func(child Token) bool {
22 return !pred(child)
23 })
24}
25
26// ChildNodes returns an iterator over children of type *Node.
27func (n *Node) ChildNodes() iter.Seq[*Node] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected