MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / IsFunction

Method IsFunction

query.go:24–31  ·  view source on GitHub ↗

IsFunction checks the current matched set of elements against a predicate and returns true if at least one of these elements matches.

(f func(int, *Selection) bool)

Source from the content-addressed store, hash-verified

22// IsFunction checks the current matched set of elements against a predicate and
23// returns true if at least one of these elements matches.
24func (s *Selection) IsFunction(f func(int, *Selection) bool) bool {
25 for i, n := range s.Nodes {
26 if f(i, newSingleSelection(n, s.document)) {
27 return true
28 }
29 }
30 return false
31}
32
33// IsSelection checks the current matched set of elements against a Selection object
34// and returns true if at least one of these elements matches.

Callers 3

BenchmarkIsFunctionFunction · 0.80
TestIsFunctionFunction · 0.80
TestIsFunctionRollbackFunction · 0.80

Calls 1

newSingleSelectionFunction · 0.85

Tested by 3

BenchmarkIsFunctionFunction · 0.64
TestIsFunctionFunction · 0.64
TestIsFunctionRollbackFunction · 0.64