mirror of
https://github.com/kepler155c/opus
synced 2025-10-16 00:07:39 +00:00
add util.any
This commit is contained in:
@@ -332,6 +332,14 @@ function Util.removeByValue(t, e)
|
||||
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)
|
||||
for _,v in pairs(t) do
|
||||
if not fn(v) then
|
||||
|
Reference in New Issue
Block a user