def line_ends_to_line_points(l_ends: list, diags: bool = False) -> list:
    """
    Args:
        l_ends: list of end points defined in [[x1, y1], [x2, y2]] format
        diags: boolean option to evaluate diagonal lines (True) or ignore (False)

    Returns:
        list of all points in [x1, y1] format that the lines cross defined by input end points
    """
    l_points = []
    for coord in l_ends:

        # y1 == y2 and x1 != x2 for horizontal lines
        if coord[0][1] == coord[1][1] and coord[0][0] != coord[1][0]:
            for x_val in range(min(coord[0][0], coord[1][0]),
                               max(coord[0][0], coord[1][0]) + 1):
                l_points.append([x_val, coord[0][1]])

        # x1 == x2 and y1 != y2 for vertical lines
        elif coord[0][0] == coord[1][0] and coord[0][1] != coord[1][1]:
            for y_val in range(min(coord[0][1], coord[1][1]),
                               max(coord[0][1], coord[1][1]) + 1):
                l_points.append([coord[0][0], y_val])

        # if evaluating diagonals, assume all remaining points represent diagonals
        elif diags:
            x_dir = 1 if coord[0][0] < coord[1][0] else -1
            y_dir = 1 if coord[0][1] < coord[1][1] else -1
            for count in range(abs(coord[0][0] - coord[1][0]) + 1):
                l_points.append([coord[0][0] + count * x_dir,
                                 coord[0][1] + count * y_dir])

        # if ignoring diagonals, return empty array
        else:
            return []

    return l_points