UNPKG

nested-query-params

Version:
14 lines (13 loc) 687 B
import { QueryParams, QueryParamVal } from "./types"; /** * Serializes the given object to a valid query parameter string. Supported * types are Arrays, Objects and basic value types. Heavily inspired by * {@link https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/object/to_query.rb#L61-L89|Rack's nested query parser}. * * @example * // returns "?one[two]=3"; * parseQuery({ one: { two: "3" } }); */ export declare function printQuery(query: QueryParams, ns?: string): string; export declare function printQueryParams(query: QueryParams, ns?: string): string; export declare function printQueryParamVal(query: QueryParamVal, ns: string): string;