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

Function armWords

ui/src/lib/steps-model.ts:305–312  ·  view source on GitHub ↗
(d: { on: string; arm: string; form: 'if' | 'switch' | 'ternary' | 'try'; not?: true })

Source from the content-addressed store, hash-verified

303 * and `else` for its default; a `try`'s arms keep their own words.
304 */
305export function armWords(d: { on: string; arm: string; form: 'if' | 'switch' | 'ternary' | 'try'; not?: true }): string {
306 if (d.form === 'if' || d.form === 'ternary') return d.not ? 'no' : 'yes';
307 if (d.not) return 'else';
308 let text = d.arm;
309 if (d.on && text.startsWith(d.on)) text = text.slice(d.on.length).trim().replace(/^===?\s*/, '');
310 if (!text) return 'yes';
311 return text.length > ARM_WORD_MAX ? `${text.slice(0, ARM_WORD_MAX - 1)}…` : text;
312}
313
314/**
315 * The one arm of one decision a connector is, when EVERY site behind it

Callers 3

armWordFunction · 0.90
markDecisionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected