MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / commonCore

Function commonCore

src/context/approach-diff.ts:65–74  ·  view source on GitHub ↗
(texts: string[], cap = 8)

Source from the content-addressed store, hash-verified

63
64/** Terms (surface forms) whose stem appears in EVERY text — the stable core of the approach. PURE. */
65export function commonCore(texts: string[], cap = 8): string[] {
66 if (!texts.length) return [];
67 const maps = texts.map(surfaceByStem);
68 const out: string[] = [];
69 for (const [s, w] of maps[0]!) {
70 if (maps.every(m => m.has(s))) out.push(w);
71 if (out.length >= cap) break;
72 }
73 return out;
74}
75
76const isMultiline = (t: string): boolean => t.split('\n').filter(l => l.trim()).length >= 3;
77

Callers 2

renderApproachDiffsFunction · 0.85

Calls 2

hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected