Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FormupSchema<Values, State>

A yup like schema to perform validation.

Type parameters

  • Values

  • State

Hierarchy

  • FormupSchema

Index

Methods

validate

  • validate(value: unknown, options?: ValidateOptions<Values, State>): Promise<Values>
  • Returns the value (a cast value if options.strict is false) if the value is valid, and throws the errors otherwise.

    This method is asynchronous and returns a Promise object, that is fulfilled with the value, or rejected with a ValidationError.

    throws

    ValidationError

    Parameters

    • value: unknown

      the data to validate

    • Optional options: ValidateOptions<Values, State>

      an object hash containing any schema options you may want to override (or specify for the first time).

    Returns Promise<Values>

validateAt

  • validateAt(path: string, value: Values, options?: ValidateOptions<Values, State>): Promise<Values>
  • Validate a deeply nested path within the schema. Similar to how reach works, but uses the resulting schema as the subject for validation.

    throws

    ValidationError

    Parameters

    • path: string

      to validate

    • value: Values

      the root value relative to the starting schema, not the value at the nested path.

    • Optional options: ValidateOptions<Values, State>

      an object hash containing any schema options you may want to override (or specify for the first time).

    Returns Promise<Values>

Generated using TypeDoc