Skip to main content


A simple and composable way to validate data in JavaScript (and TypeScript).
Go to Latest
class StructError
extends TypeError
import { StructError } from "";

StructError objects are thrown (or returned) when validation fails.

Validation logic is design to exit early for maximum performance. The error represents the first error encountered during validation. For more detail, the error.failures property is a generator function that can be run to continue validation and receive all the failures in the data.


StructError(failure: Failure, failures: () => Generator<Failure>)

Index Signatures

[x: string]: any


branch: Array<any>
failures: () => Array<Failure>
key: any
path: Array<any>
refinement: string | undefined
type: string
value: any