diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-09-24 21:01:06 +0200 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-09-25 20:16:02 +0200 |
| commit | 628406f0a50e040d4661629446c620a3a495441f (patch) | |
| tree | e1a2b783296b1779a4040b5a7ea55d72547a37e8 /sourcehut-builds/table_utils.luau | |
Diffstat (limited to 'sourcehut-builds/table_utils.luau')
| -rw-r--r-- | sourcehut-builds/table_utils.luau | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sourcehut-builds/table_utils.luau b/sourcehut-builds/table_utils.luau new file mode 100644 index 0000000..47feafa --- /dev/null +++ b/sourcehut-builds/table_utils.luau @@ -0,0 +1,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 +} |