On this page

Function validate

  • Main recursive validation function used internally. You should use validateStyleMin in the browser or validateStyle in node env.

    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?: any

        optional object of functions that will be called

      • style: any

        the style object

      • styleSpec: any

        current full spec being evaluated.

      • OptionalvalidateSpec?: any

        the 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.

Was this helpful?
SDK JS
Reference
validate