package predicate
import "github.com/gohugoio/hugo/common/predicate"
Index ¶
Types ¶
type P ¶
P is a predicate function that tests whether a value of type T satisfies some condition.
func (P[T]) And ¶
And returns a predicate that is a short-circuiting logical AND of this and the given predicates.
func (P[T]) Filter ¶
func (p P[T]) Filter(s []T) []T
Filter returns a new slice holding only the elements of s that satisfy p. Filter modifies the contents of the slice s and returns the modified slice, which may have a smaller length.
func (P[T]) FilterCopy ¶
func (p P[T]) FilterCopy(s []T) []T
FilterCopy returns a new slice holding only the elements of s that satisfy p.
func (P[T]) Negate ¶
Negate returns a predicate that is a logical negation of this predicate.
func (P[T]) Or ¶
Or returns a predicate that is a short-circuiting logical OR of this and the given predicates.
Source Files ¶
- Version
- v0.144.2 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Last checked
- 13 hours ago –
Tools for package owners.