def slice_array_on_limit(array, limit):
    """
    If array contains more items than the limit, return an array containing items up until the limit

    :param array:
    :limit: integer
    """
    if array and len(array) > limit:
        return array[0:limit]
    return array