Skip to content

Commit

Permalink
loader.lua: add loader.table.remove_value service function - remove t…
Browse files Browse the repository at this point in the history
…able element(s) by value
  • Loading branch information
DarkCaster committed Feb 15, 2018
1 parent b00fa5f commit e393a6d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ function loader.path.combine(first, second, ...)
return c
end

-- define some table management logic
loader["table"]={}

function loader.table.remove_value(target, value)
assert(type(target)=="table", "target must be a table!")
for i = #target, 1, -1 do
if target[i]==value then table.remove(target, i) end
end
return target
end

-- TODO: define some config verification logic

-- execute pre-script
Expand Down

0 comments on commit e393a6d

Please sign in to comment.