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

Function isNonNegativeInt

conformance/conformance_test.go:407–413  ·  view source on GitHub ↗
(expr ast.Expr)

Source from the content-addressed store, hash-verified

405}
406
407func isNonNegativeInt(expr ast.Expr) bool {
408 if expr.Kind() != ast.LiteralKind {
409 return false
410 }
411 val := expr.AsLiteral()
412 return val.Type() == cel.IntType && val.(types.Int) >= 0
413}

Callers 2

celIndexFunction · 0.85
celCompreVarFunction · 0.85

Calls 3

KindMethod · 0.65
AsLiteralMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected