For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Function validate
-
validate(
options: {
key: any;
objectElementValidators?: any;
style: any;
styleSpec: any;
validateSpec?: any;
value: any;
valueSpec: any;
},
): ValidationError[]Parameters
- options: {
key: any;
objectElementValidators?: any;
style: any;
styleSpec: any;
validateSpec?: any;
value: any;
valueSpec: any;
}the options object
-
key: any
string representing location of validation in style tree. Used only for more informative error reporting.
-
OptionalobjectElementValidators?: anyoptional object of functions that will be called
-
style: any
the style object
-
styleSpec: any
current full spec being evaluated.
-
OptionalvalidateSpec?: anythe validate function itself
-
value: any
current value from style being evaluated. May be anything from a high level object that needs to be descended into deeper or a simple scalar value.
-
valueSpec: any
current spec being evaluated. Tracks value.
-
Returns ValidationError[]
an array of errors, or an empty array if no errors are found.
- options: {
Main recursive validation function used internally. You should use
validateStyleMinin the browser orvalidateStylein node env.