Skip to main content

Interface: NumberValidation

Validation for Numbers.

Link

https://github.com/jquense/yup#number

Hierarchy

Properties

defined

Optional defined: []

Inherited from

BaseValidation.defined


integer

Optional integer: [message?: ValidationMessage]


lessThan

Optional lessThan: [max: number | ValidationRef, message?: ValidationMessage]


max

Optional max: [limit: number | ValidationRef, message?: ValidationMessage]


min

Optional min: [limit: number | ValidationRef, message?: ValidationMessage]


moreThan

Optional moreThan: [min: number | ValidationRef, message?: ValidationMessage]


negative

Optional negative: [message?: ValidationMessage]


notOneOf

Optional notOneOf: [values: (null | string | number | boolean)[], message?: ValidationMessage]

Inherited from

BaseValidation.notOneOf


notRequired

Optional notRequired: []

Inherited from

BaseValidation.notRequired


oneOf

Optional oneOf: [values: (null | string | number | boolean)[], message?: ValidationMessage]

Inherited from

BaseValidation.oneOf


optional

Optional optional: []

Inherited from

BaseValidation.optional


positive

Optional positive: [message?: ValidationMessage]


required

Optional required: [message?: ValidationMessage]

Inherited from

BaseValidation.required


when

Optional when: [key: string, logic: RulesLogic<never>]

Adjust the validation based on a sibling or sibling children fields.

FIXME: The example is wrong -- when clauses are indexed by position, not by name.

Example

  {
"when": {
"key": "firstName",
"logic": {
{ "==": [{ "var": "firstName" }, "will"] },
{
"type": "result",
"required": "Last name is required when first name is Will"
},
{
"type": "result",
"notRequired": []
}
}
}
}
```;

#### Inherited from

[BaseValidation](/api/interfaces/BaseValidation).[when](/api/interfaces/BaseValidation#when)