A simple and composable way to validate data in JavaScript (and TypeScript).
Go to Latest
class StructError
extends TypeError
import { StructError } from "https://deno.land/x/superstruct@v0.16.0/error.ts?s=StructError";

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>[src]
failures: () => Array<Failure>[src]
key: any[src]
path: Array<any>[src]
refinement: string | undefined[src]
type: string[src]
value: any[src]