- Param<T extends null | string | number | bigint | boolean>(
field: string,
assert?: (value: string) => T,
): ParameterDecorator Type Parameters
- T extends null | string | number | bigint | boolean
Parameters
- field: string
Optional
assert: (value: string) => T
Returns ParameterDecorator
URL parameter decorator.
@WebSocketRoute.Param()
is a parameter decorator function for the URL parameter with type casting and assertion.It's almost same with the TypedParam, but
@WebSocketRoute.Param()
is only for WebSocket protocol router function decorated by WebSocketRoute.