Skip to content

Function: matchPath() ​

ts
function matchPath(matcher, pathname): boolean;

Defined in: packages/next/src/matcher.ts:65

true if the pathname matches the pattern (or any of the patterns). Both the raw and the percent-decoded pathname are tried, so /%61dmin is protected by a rule for /admin.

Parameters ​

ParameterType
matcherPathMatcher
pathnamestring

Returns ​

boolean

Released under the MIT License. Inspired by spatie/laravel-permission.