ThroughSchemaclass

new ThroughSchema<T>({ source, ...options }: ThroughSchemaOptions<T>)
ParamType
optionsThroughSchemaOptions<T>
Allowed options for ThroughSchema. required
    .sourceSchema<T>
The source schema this schema passes through to. required
Return
ThroughSchema<T>
Schema that wraps and passes through to a source schema, used as a base for schemas that augment another schema's behaviour (e.g. NullableSchema, OptionalSchema, RequiredSchema).
PropertyType
.sourceSchema<T>
The source schema this schema passes through to. required readonly

Schema that wraps and passes through to a source schema, used as a base for schemas that augment another schema's behaviour (e.g. NullableSchema, OptionalSchema, RequiredSchema).

Examples

class WrapSchema<T> extends ThroughSchema<T> {} // Delegates `validate()` to `this.source`.

Methods

Go

ThroughSchema.validate()method

Validate an unknown input value by passing it through to the source schema.

validate(unsafeValue: unknown): T