The SearchParamsParser is a specialized parser designed to safely extract
and validate values from a URLSearchParams object. It simplifies access
to URL search parameters in a type-safe manner and offers support for
multiple input types (e.g., URLSearchParams, URL, Request, or URL
strings).
Supported Inputs
URLSearchParams: Directly parses the given URLSearchParams object.
URL: Extracts the searchParams from the URL object.
Request: Parses the URL's search parameters from a Request object.
string: Parses the search parameters from a string representing a URL.
The
SearchParamsParseris a specialized parser designed to safely extract and validate values from aURLSearchParamsobject. It simplifies access to URL search parameters in a type-safe manner and offers support for multiple input types (e.g.,URLSearchParams,URL,Request, or URL strings).Supported Inputs
URLSearchParams: Directly parses the givenURLSearchParamsobject.URL: Extracts thesearchParamsfrom theURLobject.Request: Parses the URL's search parameters from aRequestobject.string: Parses the search parameters from a string representing a URL.Example
Example
Example
Example