Path: blob/main/src/vs/workbench/contrib/issue/common/issueReporterUtil.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { rtrim } from '../../../../base/common/strings.js';67export function normalizeGitHubUrl(url: string): string {8// If the url has a .git suffix, remove it9if (url.endsWith('.git')) {10url = url.substr(0, url.length - 4);11}1213// Remove trailing slash14url = rtrim(url, '/');1516if (url.endsWith('/new')) {17url = rtrim(url, '/new');18}1920if (url.endsWith('/issues')) {21url = rtrim(url, '/issues');22}2324return url;25}262728