def is_extension(filename: str, extension: str) -> bool:
    """
    Return ``True`` if filename has the same extension
    as the target extension.

    Parameters
    ----------
    filename: :class:`str`
        The filename that you want to compare with.
    extension: :class:`str`
        The target extension that you want to compare with.

    Returns
    --------
    :class:`bool`
        ``True`` if filename has the same extension as target.
    """
    filename = filename.lower()
    if extension.startswith("."):
        extension = extension[1:]
    dot_after = filename.rfind(".")
    if dot_after == -1:
        return False
    return filename[dot_after:] == extension