MCPcopy Create free account
hub / github.com/bytebase/dbhub / tokenHasExplicitPort

Function tokenHasExplicitPort

src/utils/ssh-config-parser.ts:421–425  ·  view source on GitHub ↗

* Whether a ProxyJump token carries an explicit `:port` (vs. relying on the * default). Handles an optional `user@` prefix and bracketed IPv6 (`[host]:port`).

(token: string)

Source from the content-addressed store, hash-verified

419 * default). Handles an optional `user@` prefix and bracketed IPv6 (`[host]:port`).
420 */
421function tokenHasExplicitPort(token: string): boolean {
422 const atIndex = token.indexOf('@');
423 const hostPart = atIndex !== -1 ? token.slice(atIndex + 1) : token;
424 return hostPart.startsWith('[') ? /\]:\d+$/.test(hostPart) : /:\d+$/.test(hostPart);
425}

Callers 1

resolveJumpHostsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected