getParam
getParam(
url,param):string|null
Defined in: search-params.ts:12
The value of query parameter param in url, null when the URL has a query but not that parameter, and "" when it has no query at all.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”string | null
Example
Section titled “Example”import { getParam } from "@theholocron/uri-utils";
getParam("https://example.com?page=2&limit=10", "page"); // "2"getParam("https://example.com?page=2&limit=10", "sort"); // nullgetParam("https://example.com", "page"); // ""