diff --git a/cf-lib/util/table.lua b/cf-lib/util/table.lua index 865d683..57c7fa2 100644 --- a/cf-lib/util/table.lua +++ b/cf-lib/util/table.lua @@ -70,6 +70,18 @@ function table.filter(target, predicate) return result end +--- Filters a table by removing given key. +--- @param target table The table to filter +--- @param key string The key to remove +function table.filterKey(target, key) + return table.filter( + target, + function(_, currentKey) + return currentKey ~= key + end + ) +end + --- Concatenates two tables into a new table. --- @param table1 table The first table --- @param table2 table The second table