Spaces:
Running
Running
| export interface BenchRouteLocation { | |
| pathname: string; | |
| search: string; | |
| hash: string; | |
| } | |
| export function isBenchRoute(location: BenchRouteLocation): boolean { | |
| const pathname = location.pathname.replace(/\/+$/, ''); | |
| if (/(?:^|\/)bench(?:\/index\.html|\.html)?$/.test(pathname)) { | |
| return true; | |
| } | |
| if (new URLSearchParams(location.search).get('view') === 'bench') { | |
| return true; | |
| } | |
| return /^#\/?bench\/?$/.test(location.hash); | |
| } | |
| export function isPromptMatrixRoute(location: BenchRouteLocation): boolean { | |
| const pathname = location.pathname.replace(/\/+$/, ''); | |
| return /(?:^|\/)prompt-matrix(?:\/index\.html|\.html)?$/.test(pathname) | |
| || new URLSearchParams(location.search).get('view') === 'prompt-matrix' | |
| || /^#\/?prompt-matrix\/?$/.test(location.hash); | |
| } | |