mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
15 lines
377 B
TypeScript
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;
|
|
}
|