MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / extractHosts

Function extractHosts

Extension/src/SSH/sshHosts.ts:242–249  ·  view source on GitHub ↗
(parsedConfig: Configuration)

Source from the content-addressed store, hash-verified

240}
241
242function extractHosts(parsedConfig: Configuration): string[] {
243 const hosts: Set<string> = new Set<string>();
244 parsedConfig.filter(isHostDirective).forEach(c => {
245 getHostsFromHostConfig(c.value).forEach(h => hosts.add(h));
246 });
247
248 return Array.from(hosts.keys());
249}
250
251function getHostsFromHostConfig(hostValue: string | string[]): string[] {
252 const hosts: string[] = Array.isArray(hostValue) ? hostValue : [hostValue];

Callers 1

extractHostNamesFunction · 0.85

Calls 6

getHostsFromHostConfigFunction · 0.85
fromMethod · 0.80
keysMethod · 0.80
forEachMethod · 0.45
filterMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected