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

Method IsFunction

query.go:23–30  ·  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

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