MCPcopy Create free account
hub / github.com/AI45Lab/Code / truncate

Method truncate

sdk/node/examples/search/test_search_config.ts:49–54  ·  view source on GitHub ↗

* Truncate text to max length.

(text: string, maxLen: number)

Source from the content-addressed store, hash-verified

47 * Truncate text to max length.
48 */
49 static truncate(text: string, maxLen: number): string {
50 if (text.length <= maxLen) {
51 return text;
52 }
53 return `${text.substring(0, maxLen)}... (truncated)`;
54 }
55
56 /**
57 * Test 1: Default search configuration.

Callers 9

add_to_workingMethod · 0.45
try_parse_partial_jsonFunction · 0.45
diffMethod · 0.45
search_filesMethod · 0.45
search_simpleMethod · 0.45
testDefaultSearchMethod · 0.45
testEngineControlMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected