Assert that a value passes the struct's validation, throwing if it doesn't.
Optionalmessage: stringCreate a value with the struct's coercion logic, then validate it.
Optionalmessage: stringMask a value, coercing and validating it, but returning only the subset of
properties defined by the struct's schema. Masking applies recursively to
props of object structs only.
Optionalmessage: stringValidate a value with the struct's validation logic, returning a tuple representing the result.
You may optionally pass true for the coerce argument to coerce
the value before attempting to validate it. If you do, the result will
contain the coerced result when successful. Also, mask will turn on
masking of the unknown object props recursively if passed.
Optionaloptions: { coerce?: boolean; mask?: boolean; message?: string }
Structobjects encapsulate the validation logic for a specific type of values. Once constructed, you use theassert,isorvalidatehelpers to validate unknown input data against the struct.