Add table.filterKey

This commit is contained in:
Simon Brodtmann 2025-11-12 00:31:56 +01:00
parent e4ad298324
commit 6ca6034186

View file

@ -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