MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / usageSentence

Function usageSentence

scripts/fungrim/gen-reference-doc.ts:237–249  ·  view source on GitHub ↗

Render the engine-usage sentence ("simplification", "expansion", "solving").

(u: Usage | undefined)

Source from the content-addressed store, hash-verified

235
236/** Render the engine-usage sentence ("simplification", "expansion", "solving"). */
237function usageSentence(u: Usage | undefined): string {
238 if (!u) return '';
239 const verbs: string[] = [];
240 if (u.purposes.has('simplify')) verbs.push('simplification');
241 if (u.purposes.has('expand')) verbs.push('expansion');
242 if (u.targets.has('solve')) verbs.push('equation solving');
243 if (verbs.length === 0) return '';
244 const list =
245 verbs.length === 1
246 ? verbs[0]
247 : verbs.slice(0, -1).join(', ') + ' and ' + verbs[verbs.length - 1];
248 return `Used by the Compute Engine for ${list}.`;
249}
250
251/** Turn a reference (URL or citation string) into a markdown link. */
252function renderReference(ref: string): string {

Callers 1

renderEntryFunction · 0.85

Calls 2

hasMethod · 0.65
sliceMethod · 0.65

Tested by

no test coverage detected