from typing import Union


def enumerate_oxford(x: Union[list, str]) -> Union[None, str]:
    """
    Return as string with Oxford comma.

    Args:
        x (Union[list, str]): List or string to be formated.

    Returns:
        Union[None, str]: Formated string. None if x is None.
    """
    if isinstance(x, str):
        x = x.replace(" ", "").replace(",", "")
    else:
        x = [str(item) for item in x]

    if len(x) == 0:
        return None
    if 0 < len(x) < 3:
        return ", ".join(x)
    else:
        first_part = x[:-1]
        last_part = x[-1]
        return ", ".join(first_part) + ", and " + last_part