@callstack/react-native-legal-shared
Version:
Shared code for all packages
19 lines (18 loc) • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeRepositoryUrl = normalizeRepositoryUrl;
function normalizeRepositoryUrl(url) {
return (url
.replace('git+ssh://git@', 'git://')
.replace('.git', '')
.replace('git+https://github.com', 'https://github.com')
.replace('.git', '')
.replace('git://github.com', 'https://github.com')
.replace('.git', '')
.replace('git@github.com:', 'https://github.com/')
.replace('.git', '')
.replace('github:', 'https://github.com/')
.replace('.git', '')
// below: handling of edge case: git+ssh://git@github.com:X/Y.git -> https://github.com:X/Y
.replace('github.com:', 'github.com/'));
}