OrganizationLayout.utils.ts 460 B

12345678910111213
  1. export function getPathnameWithoutQuery(asPath?: string, fallback?: string): string {
  2. const path = asPath ?? fallback ?? ''
  3. if (typeof path !== 'string' || path.length === 0) return ''
  4. const withoutQuery = path.split('?')[0]
  5. return withoutQuery ?? path
  6. }
  7. export function isOrgMenuScope(pathname: string): boolean {
  8. if (!pathname || typeof pathname !== 'string') return false
  9. const trimmed = pathname.trim()
  10. return trimmed.startsWith('/org/')
  11. }