MCPcopy Create free account
hub / github.com/Codehagen/Badget / truncate

Function truncate

src/lib/construct-metadata.ts:64–67  ·  view source on GitHub ↗
(str: string | null, length: number)

Source from the content-addressed store, hash-verified

62}
63
64export const truncate = (str: string | null, length: number) => {
65 if (!str || str.length <= length) return str;
66 return `${str.slice(0, length - 3)}...`;
67};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected