mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
8 lines
277 B
Python
8 lines
277 B
Python
"""Shared text helpers for notification copy."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def truncate(text: str, limit: int) -> str:
|
|
"""Return ``text`` capped at ``limit`` chars, appending an ellipsis if cut."""
|
|
return text[:limit] + "..." if len(text) > limit else text
|