vtils

Home > validator > yup > MixedSchema > when

yup.MixedSchema.when() method

Signature:

when<V>(key: string, builder: {
        is: boolean | ((value: V) => boolean);
        then: GetSchema<T>;
        otherwise: GetSchema<T>;
    }): this;

Parameters

Parameter Type Description
key string  
builder { is: boolean | ((value: V) => boolean); then: GetSchema<T>; otherwise: GetSchema<T>; }  

Returns:

this