Module:Util

local util = {}

function util.corename local result = mw.ustring.gsub(mw.title.getCurrentTitle.subpageText, '%s%(.*', '')   return result end

function util.exists(object, child) if object ~= nil and object ~= '' then if child ~= nil then if object[child] ~= nil and object[child] ~= '' then return true else return false end else return true end else return false end end

function util.trim(s) return s:match'^%s*$' and '' or s:match'^%s*(.*%S)' end

function util.default(data, default) if util.exists(data) then return data else return default end end

return util