UNPKG

@roadiehq/backstage-plugin-github-pull-requests

Version:
11 lines (8 loc) 464 B
import { ANNOTATION_SOURCE_LOCATION, ANNOTATION_LOCATION } from '@backstage/catalog-model'; import gitUrlParse from 'git-url-parse'; const getHostname = (entity) => { const location = entity?.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION] ?? entity?.metadata.annotations?.[ANNOTATION_LOCATION]; return location?.startsWith("url:") ? gitUrlParse(location.slice(4)).resource : void 0; }; export { getHostname }; //# sourceMappingURL=githubUtils.esm.js.map