Function query

  • Query string middleware factory

    Type Parameters

    Returns Middleware<I, O, I & {
        query: URLSearchParams;
    }, O>

    Remarks

    The returned middleware enriches the input with a query property containing the parsed query string as URLSearchParams.

  • Query string middleware factory

    Type Parameters

    • const T extends ZFromStringsMap
    • I extends Context
    • O

    Parameters

    • schema: T

      Schema to validate the query string with

    Returns Middleware<I, O, I & {
        query: TypeOf<T>;
    }, O>

    Remarks

    The returned middleware enriches the input with a query property containing the query parsed and validated with the given schema.

  • Query string middleware factory

    Type Parameters

    • const K extends string
    • I extends Context
    • O

    Parameters

    • key: K

      Key to use for the query string property

    Returns Middleware<I, O, I & {
        [body in K]: URLSearchParams
    }, O>

    Remarks

    The returned middleware enriches the input with a property with the given key containing the parsed query string as URLSearchParams.

  • Query string middleware factory

    Type Parameters

    • const K extends string
    • const T extends ZFromStringsMap
    • I extends Context
    • O

    Parameters

    • key: K

      Key to use for the query string property

    • schema: T

      Schema to validate the query string with

    Returns Middleware<I, O, I & {
        [body in K]: TypeOf<T>
    }, O>

    Remarks

    The returned middleware enriches the input with a property with the given key containing the query parsed and validated with the given schema.

Generated using TypeDoc