UNPKG

semantic-release-gh

Version:

The official GitHub plugin, modified to accept repositoryUrl as a parameter

15 lines 634 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ParseGitHubURL = void 0; const ParseGitHubURL = (repositoryUrl) => { const [match, auth, host, path] = /^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/u.exec(repositoryUrl) || []; try { const [, owner, repo] = /^\/(?<owner>[^/]+)?\/?(?<repo>.+?)(?:\.git)?$/u.exec(new URL(match ? `ssh://${auth ? `${auth}@` : ''}${host}/${path}` : repositoryUrl).pathname); return { owner, repo }; } catch (_a) { return {}; } }; exports.ParseGitHubURL = ParseGitHubURL; //# sourceMappingURL=parse-github-url.js.map