Skip to main content

commonCriteria

Index

Functions

and

  • Map a list of field names that must be defined alongside this field when in a shape/object.


    Type parameters

    • T

custom

  • Set a callback to run custom validation logic.


    Type parameters

    • T

deprecate

  • deprecate<T>(state: SchemaState<T>, message: string): void
  • Set a message to log when this field is present.


    Type parameters

    • T

never

  • Mark that this field should never be used.


    Type parameters

    • T

notNullable

  • Disallow null values.


    Type parameters

    • T

notUndefinable

  • Disallow undefined values.


    Type parameters

    • T

nullable

  • Allow null values.


    Type parameters

    • T

only

  • Mark that this field can ONLY use a value that matches the default value.


    Type parameters

    • T

optional

  • Dont require this field to be explicitly defined when in a shape/object.


    Type parameters

    • T

or

  • Map a list of field names that must have at least 1 defined when in a shape/object.


    Type parameters

    • T

required

  • Require this field to be explicitly defined when in a shape/object.


    Type parameters

    • T

transform

  • Transform a value before it’s passed to the next criteria.


    Type parameters

    • T

undefinable

  • Allow undefined values.


    Type parameters

    • T

when

  • Validate with another schema when a condition is met.


    Type parameters

    • T

xor

  • Map a list of field names that must not be defined alongside this field when in a shape/object.


    Type parameters

    • T