MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / extractLoginName

Function extractLoginName

packages/baseai/src/add/index.ts:32–44  ·  view source on GitHub ↗

* Extracts the login name and name from a given pipe-separated string. * * @param loginAndPipe - login/pipe string to extract from. * @returns An object containing the extracted `login` and `name`.

(loginAndPipe: string)

Source from the content-addressed store, hash-verified

30 * @returns An object containing the extracted `login` and `name`.
31 */
32function extractLoginName(loginAndPipe: string) {
33 if (!loginAndPipe) return { login: '', name: '' };
34
35 const split = loginAndPipe.split('/');
36 const length = split.length;
37
38 if (length < 2) return { login: '', name: '' };
39
40 return {
41 login: split[length - 2],
42 name: split[length - 1]
43 };
44}
45
46
47/**

Callers 1

addPipeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected