aboutsummaryrefslogtreecommitdiff
path: root/sourcehut-builds/table_utils.luau
blob: 47feafa270ffbf21e79887c99386ea92d403159d (plain)
1
2
3
4
5
6
7
8
9
10
11
return {
  trim = function<T>(table: {[number]: T}, count: number): {[number]: T}
    local sliced: {[number]: T} = {}

    for i = 1, count or #table, 1 do
      sliced[#sliced+1] = table[i]
    end

    return sliced
  end
}