from typing import Any
from typing import Optional


def toString(value: Any) -> Optional[str]:
    """
    Coerces the input value to a string.
    Null values and empty strings are mapped to null.
    """
    if value is None:
        return None
    return str(value)