```python
def strip_ends(text: str, mark: str) -> str:
    """The text with a character removed from both of its ends."""
    if len(mark) > 1 or not isinstance(mark, str):
        raise ValueError("mark must be an empty string or a single character")
    
    if text.startswith(mark):
        text = text[1:]
    if text.endswith(mark):
        text = text[:-1]
    return text
```