Skip to content

Function.attachStandard

github-actions[bot] edited this page Jul 8, 2026 · 25 revisions

umt / attachStandard

Function: attachStandard()

attachStandard<Input, Output, F>(validator): F & StandardSchemaV1<Input, Output>

Defined in: Validate/standardSchema.ts:118

Attaches a Standard Schema V1 ~standard property to a UMT validator function in place. The validator's existing call signature, attached helpers (such as shape on object() or implement on func()), and return type are preserved untouched; only the ~standard property is added.

Validation is delegated to the wrapped validator. On success the input value is returned through the Standard Schema value field; on failure a single issue carrying the validator's message is emitted. UMT validators never transform their input, so Input and Output default to the same type.

Type Parameters

Input

Input

The input type advertised through ~standard.types

Output

Output = Input

The output type advertised through ~standard.types

F

F extends (...arguments_) => UmtValidatorResult = (...arguments_) => UmtValidatorResult

The validator function being augmented

Parameters

validator

F

The validator function to augment

Returns

F & StandardSchemaV1<Input, Output>

The same function with ~standard attached

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally