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
@UsePipeor@Validate'spipesapplies the class, after validation
Members
transform
transform(value: In, context: ExecutionContext): Out | Promise<Out>Transforms one value.
Parameters
| Name | Type | Description |
|---|---|---|
value | In | The value, after validation and any pipe before this one. |
context | ExecutionContext | The call being handled; |
Returns
Out | Promise<Out>The value the handler receives. Throw to stop the call; the error reaches the filters.
See also
- Pipe
- UsePipe