MCPcopy Create free account
hub / github.com/1jehuang/jcode / truncate

Function truncate

scripts/jcode_monitor.py:133–137  ·  view source on GitHub ↗

Truncate string with ellipsis

(s: str, max_len: int)

Source from the content-addressed store, hash-verified

131
132
133def truncate(s: str, max_len: int) -> str:
134 """Truncate string with ellipsis"""
135 if len(s) <= max_len:
136 return s
137 return s[:max_len-3] + "..."
138
139
140def render_dashboard(state: MonitorState, width: int = 80):

Callers 1

render_dashboardFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected