MCPcopy Create free account
hub / github.com/cel-expr/cel-go / exprEqualsNeedle

Function exprEqualsNeedle

cel/folding.go:681–689  ·  view source on GitHub ↗
(needle, target ast.Expr)

Source from the content-addressed store, hash-verified

679}
680
681func exprEqualsNeedle(needle, target ast.Expr) bool {
682 if needle.Kind() == ast.LiteralKind && target.Kind() == ast.LiteralKind {
683 return target.AsLiteral().Equal(needle.AsLiteral()) == types.True
684 }
685 if needle.Kind() == ast.IdentKind && target.Kind() == ast.IdentKind {
686 return target.AsIdent() == needle.AsIdent()
687 }
688 return false
689}
690
691func collectionContainsNeedle(needle, haystack ast.Expr) bool {
692 if needle.Kind() != ast.LiteralKind && !isSelfEqualIdent(needle) {

Callers 1

collectionContainsNeedleFunction · 0.85

Calls 4

KindMethod · 0.65
EqualMethod · 0.65
AsLiteralMethod · 0.65
AsIdentMethod · 0.65

Tested by

no test coverage detected