Want to contribute? Join the Discord and ask for the editor role.
View source for Module:Enum
From RTGame Wiki
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
-- <nowiki> awawa
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
local p = {}
function p.all(enum, fn, clone)
checkType('Module:Enum.all', 1, enum, 'table')
checkType('Module:Enum.all', 2, fn, 'function', true)
checkType('Module:Enum.all', 3, clone, 'boolean', true)
if clone then enum = mw.clone(enum) end
fn = fn or function(item) return item end
for _, item in ipairs(enum) do
if not fn(item) then
return false
end
end
return true
end
000
1:0
Template used on this page:
Return to Module:Enum.