• 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.

    Type Parameters

    • T extends null | string | number | bigint | boolean

    Parameters

    • field: string

      URL parameter field name

    • Optionalassert: (value: string) => T

    Returns ParameterDecorator