Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "src/validators/oneOf"

Index

Functions

Functions

oneOf

  • Validates that the specified value is one of the list's item.

    example
    useForm(({ oneOf }) => ({
      theme: [oneOf(["dark", "light"])]
    }));

    Type parameters

    • Params

    Parameters

    • list: any[]

      The available list of values.

    • Optional options: RuleOptions

      The validator options.

    Returns Validator<Params>

    The validation object.

Generated using TypeDoc