from pathlib import Path


def checkExtension(fullpath, extension):
    """Check if file has desired extension.

    Args:
        fullpath (str or pathlib.Path): path to file.
        extension (str): string extension. No need to put dot in front of it.

    Returns
        True if file has an extension and it macth with `extension`. False if
        it does not match and -1 if file does not have extension.
    """
    filename = Path(fullpath)
    extension = extension.split('.')[-1]

    a = filename.name.split('.')
    if len(a) > 1:
        ext = a[-1]
        return extension == ext
    else:
        ext = None
        return -1