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
SearchParamsParser
is a specialized parser designed to safely extract and validate values from aURLSearchParams
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 givenURLSearchParams
object.URL
: Extracts thesearchParams
from theURL
object.Request
: Parses the URL's search parameters from aRequest
object.string
: Parses the search parameters from a string representing a URL.Example
Example
Example
Example