View source for Module:Utils
From Halopedia, the Halo wiki
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local utils = {}
function utils.tableEmpty( tab )
return next( tab ) == nil
end
function utils.defaultIfEmpty( val, default )
if val == nil or val == '' or ( type( val ) == 'table' and utils.tableEmpty( val ) ) then
return default
else
return val
end
end
function utils.loadDataIfExists( name )
local success, data = pcall( mw.loadData, name )
if success then
return data
else
return nil
000
1:0
Template used on this page:
Return to Module:Utils.