MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / truncateToWidth

Function truncateToWidth

cli/src/components/choice-ad-banner.tsx:29–33  ·  view source on GitHub ↗
(text: string, width: number)

Source from the content-addressed store, hash-verified

27}
28
29function truncateToWidth(text: string, width: number): string {
30 if (width <= 0) return ''
31 if (text.length <= width) return text
32 return text.slice(0, width - 1) + '…'
33}
34
35export const extractDomain = (url: string): string => {
36 try {

Callers 1

ChoiceAdBannerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected