MCPcopy
hub / github.com/simstudioai/sim / truncate

Function truncate

packages/utils/src/string.ts:11–13  ·  view source on GitHub ↗
(str: string, sliceLength: number, suffix = '...')

Source from the content-addressed store, hash-verified

9 * truncate('hi', 10) // 'hi'
10 */
11export function truncate(str: string, sliceLength: number, suffix = '...'): string {
12 return str.length > sliceLength ? str.slice(0, sliceLength) + suffix : str
13}
14
15/**
16 * Strips a trailing `_vN` version suffix from `value`, yielding the base type.

Callers 15

parseTemporalResponseFunction · 0.90
parseConvexResponseFunction · 0.90
cellFunction · 0.90
formatValueForDisplayFunction · 0.90
getDisplayValueFunction · 0.90
resolveFilterFieldLabelFunction · 0.90
sanitizeUrlForLogFunction · 0.90
executeFunction · 0.90
serializeCustomToolFunction · 0.90
serializeSkillFunction · 0.90
runTableImportFunction · 0.90
markTableUpdateFailedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected