MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / decodeTrail

Function decodeTrail

ui/src/lib/trail-codec.ts:50–66  ·  view source on GitHub ↗
(encoded: string | null)

Source from the content-addressed store, hash-verified

48}
49
50export function decodeTrail(encoded: string | null): TrailHop[] {
51 if (!encoded) return [];
52 const hops: TrailHop[] = [];
53 for (const token of encoded.split(',')) {
54 if (token.length < 2) continue;
55 const dir = CHAR_TO_DIR[token[0] as string];
56 if (!dir) continue;
57 let id: string;
58 try {
59 id = decodeURIComponent(token.slice(1));
60 } catch {
61 id = token.slice(1);
62 }
63 if (id) hops.push({ id, name: null, kind: null, dir });
64 }
65 return hops;
66}
67

Callers 2

hydrateFunction · 0.90

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected