25
return authority.substr(0, pos);
26
}
28
>
/**
29
>
* Returns the suffix part of the authority after the '+' character.
30
>
* For remote connections, this is typically the server/tunnel identifier.
31
>
* Examples:
32
>
* - For tunnels: `tunnel+myTunnel` returns `myTunnel`
33
>
* - For SSH: `ssh+myserver` returns `myserver`
34
>
* - For localhost: `localhost:8000` returns `undefined`
35
>
* @param authority The remote authority string.
36
>
* @returns The suffix after the '+' character, or undefined if there is no '+' character.
37
>
*/
38
>
export function getRemoteServerRootPath(authority: string): string | undefined;
39
>
export function getRemoteServerRootPath(authority: undefined): undefined;
40
>
export function getRemoteServerRootPath(authority: string | undefined): string | undefined;
41
>
export function getRemoteServerRootPath(authority: string | undefined): string | undefined {
42
if (!authority) {
43
return undefined;