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

Function trail

__tests__/ui-trails-model.test.ts:47–65  ·  view source on GitHub ↗
(hops: WireTrailHop[], over: Partial<WireTrail> = {})

Source from the content-addressed store, hash-verified

45}
46
47function trail(hops: WireTrailHop[], over: Partial<WireTrail> = {}): WireTrail {
48 const resolved = hops.filter((h) => h.id !== null);
49 return {
50 id: 'a-walk',
51 name: 'A walk',
52 note: '',
53 author: 'Ada',
54 createdAt: '2026-08-01T00:00:00.000Z',
55 updatedAt: '2026-08-02T00:00:00.000Z',
56 hops,
57 resolved: resolved.length,
58 intact: hops.every((h) => h.status === 'ok'),
59 encoded: resolved.length > 0 ? resolved.map((h) => `d${h.id}`).join(',') : null,
60 openFrom: 1,
61 openCount: resolved.length,
62 openId: resolved.length > 0 ? (resolved[resolved.length - 1] as WireTrailHop).id : null,
63 ...over,
64 };
65}
66
67describe('trailMeta', () => {
68 it('reports the SAVED length, whatever became of the hops', () => {

Callers 1

Calls 2

mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected