MCPcopy Create free account
hub / github.com/andybalholm/cascadia / attributeSubstringSelector

Function attributeSubstringSelector

selector.go:252–260  ·  view source on GitHub ↗

attributeSubstringSelector returns a Selector that matches nodes where the attribute named key contains val.

(key, val string)

Source from the content-addressed store, hash-verified

250// attributeSubstringSelector returns a Selector that matches nodes where
251// the attribute named key contains val.
252func attributeSubstringSelector(key, val string) Selector {
253 return attributeSelector(key,
254 func(s string) bool {
255 if strings.TrimSpace(s) == "" {
256 return false
257 }
258 return strings.Contains(s, val)
259 })
260}
261
262// attributeRegexSelector returns a Selector that matches nodes where
263// the attribute named key matches the regular expression rx

Callers 1

Calls 1

attributeSelectorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…