MCPcopy Create free account
hub / github.com/Marus/cortex-debug / parseHostPort

Function parseHostPort

src/common.ts:565–579  ·  view source on GitHub ↗
(hostPort: string)

Source from the content-addressed store, hash-verified

563}
564
565export function parseHostPort(hostPort: string) {
566 let port: number;
567 let host = '127.0.0.1';
568 const match = hostPort.match(/(.*)\:([0-9]+)/);
569 if (match) {
570 host = match[1] ? match[1] : host;
571 port = parseInt(match[2], 10);
572 } else {
573 if (hostPort.startsWith(':')) {
574 hostPort = hostPort.slice(1);
575 }
576 port = parseInt(hostPort, 10);
577 }
578 return { port: port, host: host };
579}
580
581export function getNonce() {
582 let text = '';

Callers 1

startMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected