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

Function ExtendedValidations

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

214// - Ensure regex strings are valid
215// - Disable mixed type list and map literals
216func ExtendedValidations() EnvOption {
217 return ASTValidators(
218 ValidateDurationLiterals(),
219 ValidateTimestampLiterals(),
220 ValidateRegexLiterals(),
221 ValidateHomogeneousAggregateLiterals(),
222 )
223}
224
225// ValidateDurationLiterals ensures that duration literal arguments are valid immediately after type-check.
226func ValidateDurationLiterals() ASTValidator {

Callers 6

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 6

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