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

Function ExtendedValidations

cel/validator.go:190–197  ·  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

188// - Ensure regex strings are valid
189// - Disable mixed type list and map literals
190func ExtendedValidations() EnvOption {
191 return ASTValidators(
192 ValidateDurationLiterals(),
193 ValidateTimestampLiterals(),
194 ValidateRegexLiterals(),
195 ValidateHomogeneousAggregateLiterals(),
196 )
197}
198
199// ValidateDurationLiterals ensures that duration literal arguments are valid immediately after type-check.
200func 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