map.ts 498 B

123456789101112131415
  1. import { BOARD_POSITION_DIRECTOR, BOARD_POSITION_OBSERVER } from "../data/board";
  2. export function mapMastodonUrlToHandle(mastodonUrl: string): string {
  3. let parts = mastodonUrl.match(/https:\/\/([\w\.]+)\/@([\w]+)/);
  4. return `${parts[2]}@${parts[1]}`;
  5. }
  6. export function mapBoardPositionToLabel(position: string): string {
  7. switch (position) {
  8. case BOARD_POSITION_DIRECTOR: return "Board Director";
  9. case BOARD_POSITION_OBSERVER: return "Board Observer";
  10. default: return "";
  11. }
  12. }