diff --git a/cf-lib/util/table.lua b/cf-lib/util/table.lua index 3f829a0..0e8f32b 100644 --- a/cf-lib/util/table.lua +++ b/cf-lib/util/table.lua @@ -83,4 +83,13 @@ function table.concat(table1, table2) table.insert(result, v) end return result +end + +--- Trims nil values from a table. +--- @param target table The table to trim +--- @return table The trimmed table +function table.trim(target) + return table.filter(target, function(v) + return v ~= nil + end) end \ No newline at end of file