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

Function joinWith

ui/src/lib/conditions.ts:89–96  ·  view source on GitHub ↗

Tokens joined by a keyword: `a AND b AND c`.

(groups: readonly WordToken[][], kw: 'AND' | 'OR')

Source from the content-addressed store, hash-verified

87
88/** Tokens joined by a keyword: `a AND b AND c`. */
89function joinWith(groups: readonly WordToken[][], kw: 'AND' | 'OR'): WordToken[] {
90 const out: WordToken[] = [];
91 groups.forEach((g, i) => {
92 if (i > 0) out.push(KW(kw));
93 out.push(...g);
94 });
95 return out;
96}
97
98export function joinTokens(tokens: readonly WordToken[]): string {
99 return tokens.map((t) => t.text).join(' ');

Callers 3

whenTokensFunction · 0.85
commonTokensFunction · 0.85
restTokensFunction · 0.85

Calls 2

KWFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected