Skip to content

gunshi / default / ValidationErrorsDecorator

Type Alias: ValidationErrorsDecorator()<G>

ts
type ValidationErrorsDecorator<G> = (baseRenderer, ctx, error) => Promise<string>;

Validation errors renderer decorator type. A function that wraps a validation errors renderer to add or modify its behavior.

Type Parameters

Type ParameterDefault typeDescription
G extends GunshiParamsConstraintDefaultGunshiParamsA type extending GunshiParams to specify the shape of command context.

Parameters

ParameterTypeDescription
baseRenderer(ctx, error) => Promise<string>The base validation errors renderer function to decorate
ctxReadonly<CommandContext<G>>The command context
errorAggregateErrorThe aggregate error containing validation errors

Returns

Promise<string>

The decorated result

Since

v0.27.0

Released under the MIT License.