MCPcopy Index your code
hub / github.com/iptv-org/iptv / truncate

Function truncate

scripts/utils.ts:33–38  ·  view source on GitHub ↗
(string: string, limit: number = 100)

Source from the content-addressed store, hash-verified

31}
32
33export function truncate(string: string, limit: number = 100) {
34 if (!string) return string
35 if (string.length < limit) return string
36
37 return string.slice(0, limit - 3) + '...'
38}
39
40type StreamInfo = {
41 resolution: { width: number; height: number }

Callers 3

drawTableFunction · 0.90
selectChannelFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected