MCPcopy Create free account
hub / github.com/chainjet/platform / addEllipsis

Function addEllipsis

libs/common/src/utils/string.utils.ts:51–56  ·  view source on GitHub ↗
(str: string, maxLength: number)

Source from the content-addressed store, hash-verified

49}
50
51export function addEllipsis(str: string, maxLength: number): string {
52 if (str.length > maxLength) {
53 return str.substr(0, maxLength).trim() + '...'
54 }
55 return str
56}

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected