mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 09:35:39 -05:00
19 lines
779 B
TypeScript
19 lines
779 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
|
|
const knownSchemes = ['http:', 'https:', 'file:', 'mailto:', 'data:', `${vscode.env.uriScheme}:`, 'vscode:', 'vscode-insiders:', 'vscode-resource:'];
|
|
|
|
export function getUriForLinkWithKnownExternalScheme(
|
|
link: string,
|
|
): vscode.Uri | undefined {
|
|
if (knownSchemes.some(knownScheme => link.toLowerCase().startsWith(knownScheme))) {
|
|
return vscode.Uri.parse(link);
|
|
}
|
|
|
|
return undefined;
|
|
}
|