Function: pathMatch()
pathMatch(
input,path):boolean
Convenience wrapper over UrlBuilder.pathMatches: coerce
input via urlBuilder and test its pathname against path.
Returns false for input that can’t be parsed into a URL.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
Example
Section titled “Example”pathMatch("/api/cool?q=1", "/api"); // truepathMatch("/apicool", "/api"); // falsepathMatch("https://host/api", "/api"); // truepathMatch(request, "/api/v2"); // fetch Request