Files
2024-02-15 17:01:50 +00:00

15 lines
377 B
TypeScript

import type {Location} from 'history';
export function extractRoute(location: Location) {
if (location.pathname.match(/^\/starfish\/api\//)) {
return 'api';
}
if (location.pathname.match(/^\/starfish\/database\//)) {
return 'database';
}
if (location.pathname.match(/^\/starfish\/endpoint-overview\//)) {
return 'endpoint-overview';
}
return null;
}