mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-19 07:13:13 +09:00
table.autokey still not working
This commit is contained in:
1 parent
3283fefe72
commit
8cfc6db0f4
1 file changed
+2
-2
@@ -268,10 +268,10 @@ end
|
|||||||
-- @tparam table tbl the table that will be searched
|
-- @tparam table tbl the table that will be searched
|
||||||
-- @tparam string str the string that will be looked for in the keys
|
-- @tparam string str the string that will be looked for in the keys
|
||||||
function table.autokey(tbl,str)
|
function table.autokey(tbl,str)
|
||||||
|
if not ExpLib.type_error(str,'string','Search string for table.autokey is not a string.') then return end
|
||||||
local _return = {}
|
local _return = {}
|
||||||
for key,value in pairs(tbl) do
|
for key,value in pairs(tbl) do
|
||||||
if ExpLib.is_type(key,'string') and string.contains(string.lower(key),string.lower(str)) then table.insert(_return,value) end
|
if string.contains(string.lower(key),string.lower(str)) then table.insert(_return,value) end
|
||||||
if not ExpLib.is_type(key,'string') then log(serpent.line(tbl)) end
|
|
||||||
end
|
end
|
||||||
return _return[1] or false
|
return _return[1] or false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user