Skip to main content

Type Alias: StructValidator

StructValidator = (value, field, context) => void

Runs on pack and rejects a value by throwing. It sees the value as the caller gave it (or the field's default), before any StructFieldOptions.packTransform.

Parameters

value

any

The value about to be packed.

field

string

The field's name, for the error message.

context

{ input }, the whole object being packed.

input

StructValues

Returns

void