from typing import Any
from typing import List


def append_to_array(obj: dict, key: str, value: Any) -> List[Any]:
    """
    Append to array in key. When key is empty, array will be created.

    :param obj: dict object, key may be added or modified
    :param key: key name
    :param value: value will be add to array in key or one-value array will be created
    :return: array from key
    """
    o = obj.get(key, [])
    o.append(value)
    obj[key] = o
    return o