mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
chore: update to Fumadocs 15.7 (#4154)
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com> Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
This commit is contained in:
10
docs/lib/is-active.ts
Normal file
10
docs/lib/is-active.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function isActive(
|
||||
url: string,
|
||||
pathname: string,
|
||||
nested = true,
|
||||
): boolean {
|
||||
if (url.endsWith("/")) url = url.slice(0, -1);
|
||||
if (pathname.endsWith("/")) pathname = pathname.slice(0, -1);
|
||||
|
||||
return url === pathname || (nested && pathname.startsWith(`${url}/`));
|
||||
}
|
||||
Reference in New Issue
Block a user