extractRoute.tsx 272 B

1234567891011
  1. import type {Location} from 'history';
  2. export function extractRoute(location: Location) {
  3. if (location.pathname.match(/^\/starfish\/api\//)) {
  4. return 'api';
  5. }
  6. if (location.pathname.match(/^\/starfish\/database\//)) {
  7. return 'database';
  8. }
  9. return null;
  10. }