ThroughSchema.validate()method
Validate an unknown input value by passing it through to the source schema.
validate(unsafeValue: unknown): T
new ThroughSchema<T>({ source, ...options }: ThroughSchemaOptions<T>)| Param | Type | |
|---|---|---|
options | ThroughSchemaOptions<T> | Allowed options for ThroughSchema. required |
.source | Schema<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). |
| Property | Type | |
|---|---|---|
.source | Schema<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).
class WrapSchema<T> extends ThroughSchema<T> {} // Delegates `validate()` to `this.source`.Validate an unknown input value by passing it through to the source schema.
validate(unsafeValue: unknown): T