MCPcopy
hub / github.com/PuerkitoBio/goquery / IsMatcher

Method IsMatcher

query.go:13–22  ·  view source on GitHub ↗

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

(m Matcher)

Source from the content-addressed store, hash-verified

11// IsMatcher checks the current matched set of elements against a matcher and
12// returns true if at least one of these elements matches.
13func (s *Selection) IsMatcher(m Matcher) bool {
14 if len(s.Nodes) > 0 {
15 if len(s.Nodes) == 1 {
16 return m.Match(s.Nodes[0])
17 }
18 return len(m.Filter(s.Nodes)) > 0
19 }
20
21 return false
22}
23
24// IsFunction checks the current matched set of elements against a predicate and
25// returns true if at least one of these elements matches.

Callers 3

IsMethod · 0.95
getParentsNodesFunction · 0.80
getSiblingNodesFunction · 0.80

Calls 2

MatchMethod · 0.65
FilterMethod · 0.65

Tested by

no test coverage detected