from typing import Any
import json


def to_json(thing: Any, indent=4, sort_keys=True, ensure_ascii=False) -> str:
    """Generic JSON exporter

    Args:
        thing (Any): Object to convert to JSON string
        indent (int, optional): JSON string ident. Defaults to 4.
        sort_keys (bool, optional): If keys are shorted. Defaults to True.

    Returns:
        str: Returns an JSON formated string
    """

    return json.dumps(thing, indent=indent, sort_keys=sort_keys,
                      ensure_ascii=ensure_ascii)