(fragment, reporter)
| 35670 | } |
| 35671 | |
| 35672 | function explodeHostedGitFragment(fragment, reporter) { |
| 35673 | const hash = parseHash(fragment); |
| 35674 | |
| 35675 | const preParts = fragment.split('@'); |
| 35676 | if (preParts.length > 2) { |
| 35677 | fragment = preParts[1] + '@' + preParts[2]; |
| 35678 | } |
| 35679 | |
| 35680 | const parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash |
| 35681 | .replace(/.*:(.*)/, '$1') // Strip prefixed protocols |
| 35682 | .replace(/.git$/, '') // Strip the .git suffix |
| 35683 | .split('/'); |
| 35684 | |
| 35685 | const user = parts[parts.length - 2]; |
| 35686 | const repo = parts[parts.length - 1]; |
| 35687 | |
| 35688 | if (user === undefined || repo === undefined) { |
| 35689 | throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); |
| 35690 | } |
| 35691 | |
| 35692 | return { |
| 35693 | user, |
| 35694 | repo, |
| 35695 | hash |
| 35696 | }; |
| 35697 | } |
| 35698 | |
| 35699 | class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).default { |
| 35700 | constructor(request, fragment) { |
no test coverage detected