mirror of https://github.com/kepler155c/opus
add util.any
This commit is contained in:
parent
6ef23908de
commit
0e921edaf5
|
@ -332,6 +332,14 @@ function Util.removeByValue(t, e)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Util.any(t, fn)
|
||||||
|
for _,v in pairs(t) do
|
||||||
|
if fn(v) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function Util.every(t, fn)
|
function Util.every(t, fn)
|
||||||
for _,v in pairs(t) do
|
for _,v in pairs(t) do
|
||||||
if not fn(v) then
|
if not fn(v) then
|
||||||
|
|
Loading…
Reference in New Issue