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

Function ExtendedValidations

cel/validator.go:206–213  ·  view source on GitHub ↗

ExtendedValidations collects a set of common AST validations which reduce the likelihood of runtime errors. - Validate duration and timestamp literals - Ensure regex strings are valid - Disable mixed type list and map literals

()

Source from the content-addressed store, hash-verified

204// - Ensure regex strings are valid
205// - Disable mixed type list and map literals
206func ExtendedValidations() EnvOption {
207 return ASTValidators(
208 ValidateDurationLiterals(),
209 ValidateTimestampLiterals(),
210 ValidateRegexLiterals(),
211 ValidateHomogeneousAggregateLiterals(),
212 )
213}
214
215// ValidateDurationLiterals ensures that duration literal arguments are valid immediately after type-check.
216func ValidateDurationLiterals() ASTValidator {

Callers 5

compileRuleMethod · 0.92
compileFunction · 0.92
TestBlockEvalFunction · 0.92
TestExtendedValidationsFunction · 0.85
TestEnvToConfigFunction · 0.85

Calls 5

ASTValidatorsFunction · 0.85
ValidateDurationLiteralsFunction · 0.85
ValidateRegexLiteralsFunction · 0.85

Tested by 5

compileRuleMethod · 0.74
compileFunction · 0.74
TestBlockEvalFunction · 0.74
TestExtendedValidationsFunction · 0.68
TestEnvToConfigFunction · 0.68