from typing import List
from typing import Any
from typing import Union


def trim_results_by_limit(results: List[Any], limit: Union[int, str] = 100) -> List[Any]:
    """Trim list of results so only a limited number is returned.

    Args:
        results: The list of results.
        limit: The upper limit of the results to return. If limit is set to -1 all results will be returned.

    Return the trimmed results.
    """
    if int(limit) == -1:
        return results
    return results[:int(limit)]