Skip to content
GitHub

PipeInterface

interface in meocord/interface Since 4.1.0

interface PipeInterface<In = any, Out = any>

What a pipe implements: transform, which turns one input value into what the handler receives.

Implement it on a class marked with Pipe, and apply the class with UsePipe or @Validate(schema, { pipes }): to turn an id into an account, say. One instance is shared by every call.

Where it runs

  • Pipes — where @UsePipe or @Validate's pipes applies the class, after validation

Members

transform

transform(value: In, context: ExecutionContext): Out | Promise<Out>

Transforms one value.

Parameters

NameTypeDescription
valueIn

The value, after validation and any pipe before this one.

contextExecutionContext

The call being handled; getParams() returns this use's { provide, params } values.

Returns

Out | Promise<Out>

The value the handler receives. Throw to stop the call; the error reaches the filters.

See also

  • Pipe
  • UsePipe