from typing import Optional
from typing import List


def compact(array: Optional[List]) -> Optional[List]:
    """Compact an list by removing `None` elements. If the result is an empty list, return `None`
    
    :param array: Inital list to compact
    :type array: List
    :return: Final compacted list or None
    :rtype: Optional[List]
    """
    if isinstance(array, dict):
        array = list(array.values())
    if isinstance(array, List):
        array = [e for e in array if e is not None]
        if len(array) > 0:
            return array
    return None