debian-forge-composer/vendor/github.com/dprotaso/go-yit/aggregates.go
Sanne Raymaekers b2700903ae go.mod: bump github.com/getkin/kin-openapi to v0.131.0
As deepmap/oapi-codegen didn't work with this newer version, upgrade to
oapi-codegen/oapi-codegen v2.

Mitigating CVE-2025-30153
2025-03-26 11:13:14 +01:00

25 lines
478 B
Go

package yit
import "gopkg.in/yaml.v3"
func (next Iterator) AnyMatch(p Predicate) bool {
iterator := next.Filter(p)
_, ok := iterator()
return ok
}
func (next Iterator) AllMatch(p Predicate) bool {
result := true
for node, ok := next(); ok && result; node, ok = next() {
result = result && p(node)
}
return result
}
func (next Iterator) ToArray() (result []*yaml.Node) {
for node, ok := next(); ok; node, ok = next() {
result = append(result, node)
}
return
}