from typing import OrderedDict


def map_constructor(loader, node):
    """
    Constructs a map using OrderedDict.

    :param loader: YAML loader
    :param node: YAML node
    :return: OrderedDictionary data
    """
    loader.flatten_mapping(node)
    return OrderedDict(loader.construct_pairs(node))