MCPcopy Create free account
hub / github.com/Snapchat/Valdi / decodePidAndPort

Function decodePidAndPort

valdi/vscode_debugger/src/ui/processPicker.ts:130–133  ·  view source on GitHub ↗
(encoded: string)

Source from the content-addressed store, hash-verified

128
129const encodePidAndPort = (processId: number, port?: number) => `${processId}:${port ?? ''}`;
130const decodePidAndPort = (encoded: string) => {
131 const [pid, port] = encoded.split(':');
132 return { pid: Number(pid), port: port ? Number(port) : undefined };
133};
134
135async function listProcesses(): Promise<IProcessItem> {
136 const nodeProcessPattern = /^(?:node|iojs)$/i;

Callers 1

resolveProcessIdFunction · 0.85

Calls 2

splitMethod · 0.80
NumberClass · 0.50

Tested by

no test coverage detected