Merge pull request #1 from Gael-de-Sailly/deco_fix
Small fix: add function "table.contains_substring"master
commit
83fae8d0cb
|
@ -1,4 +1,19 @@
|
|||
function table.contains_substring(t, s)
|
||||
if type(s) ~= "string" then
|
||||
return nil
|
||||
end
|
||||
|
||||
for key, value in pairs(t) do
|
||||
if type(value) == 'string' and s:find(value) then
|
||||
if key then
|
||||
return key
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Copy all the decorations except the ones I don't like.
|
||||
-- This is currently used to remove the default trees.
|
||||
|
|
Loading…
Reference in New Issue