from flyers import strs


def check_null(s, name: str):
    if s is None:
        raise ValueError(f"The '{name}' cannot be null")


def check_blank(s: str, name: str):
    if strs.is_blank(s):
        raise ValueError(f"The '{name}' cannot be blank")


def check_list_empty(l: list):
    if len(l) == 0:
        raise ValueError(f"The list cannot be empty")


def check_dict_exists(d: dict, key: str):
    if key not in d:
        raise ValueError(f"The dict don't exists the '{key}' key")
