IsMatcher checks the current matched set of elements against a matcher and returns true if at least one of these elements matches.
(m Matcher)
| 11 | // IsMatcher checks the current matched set of elements against a matcher and |
| 12 | // returns true if at least one of these elements matches. |
| 13 | func (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. |
no test coverage detected