* Validate 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 success
(
value: unknown,
options: {
coerce?: boolean
mask?: boolean
message?: string
} = {}
)
| 105 | */ |
| 106 | |
| 107 | validate( |
| 108 | value: unknown, |
| 109 | options: { |
| 110 | coerce?: boolean |
| 111 | mask?: boolean |
| 112 | message?: string |
| 113 | } = {} |
| 114 | ): [StructError, undefined] | [undefined, T] { |
| 115 | return validate(value, this, options) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
no test coverage detected