UNPKG

git-release-manager

Version:

A tool to generate release notes from git commit history

14 lines 615 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseRemoteUrl = parseRemoteUrl; function parseRemoteUrl(remoteUrl) { if (!remoteUrl) return null; const match = RegExp(/(?:https?:\/\/|git@)([\w.-]+)(?:[:/])([\w.-]+)\/([\w.-]+?)(?:\.git)?$/i).exec(remoteUrl); if (!match) throw new Error(`Could not parse remote URL: ${remoteUrl}`); const [_, host, owner, repository] = match; const repoUrl = `https://${host}/${owner}/${repository}`; return { url: remoteUrl, host, owner, repository, repoUrl }; } //# sourceMappingURL=remoteHandler.js.map