mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 16:06:02 +01:00
refactor(table): change match to matches
This commit is contained in:
@@ -26,7 +26,7 @@ local function contains(tbl, value)
|
|||||||
end
|
end
|
||||||
table.contains = contains
|
table.contains = contains
|
||||||
|
|
||||||
local function match(t1, t2)
|
local function matches(t1, t2)
|
||||||
if t1 == t2 then return true end
|
if t1 == t2 then return true end
|
||||||
if type(t1) ~= 'table' then return false end
|
if type(t1) ~= 'table' then return false end
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ local function match(t1, t2)
|
|||||||
for _, v2 in pairs(t2) do
|
for _, v2 in pairs(t2) do
|
||||||
if v == v2 then
|
if v == v2 then
|
||||||
matched_values += 1
|
matched_values += 1
|
||||||
elseif match(v, v2) then
|
elseif matches(v, v2) then
|
||||||
values += 1
|
values += 1
|
||||||
matched_values += #v
|
matched_values += #v
|
||||||
end
|
end
|
||||||
@@ -48,6 +48,6 @@ local function match(t1, t2)
|
|||||||
end
|
end
|
||||||
return matched_values == values
|
return matched_values == values
|
||||||
end
|
end
|
||||||
table.match = match
|
table.matches = matches
|
||||||
|
|
||||||
return table
|
return table
|
||||||
Reference in New Issue
Block a user