from typing import Any
from typing import Optional


def to_code(node: Any) -> Optional[str]:
    """
    Reconstruct code for the given node, and strip it of whitespace.

    Args:
        node (Any): An object representing a node of the Parso abstract syntax tree.

    Returns:
        str: The string representation of the abstract syntax tree node.
    """
    if node is None:
        return None
    return node.get_code().strip()