Module:Utils

From Annwan’s Wiki
Revision as of 08:48, 15 April 2025 by Annwan (talk | contribs) (Created page with "local _m = {} _m.def = function(a, b) return (a ~= nil and a ~= "") and a or b end _m._a = function (x) if type(x) ~= "table" then return x end if x.args then return x.args[1] end return x[1] end return _m")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Utils/doc

local _m = {}

_m.def = function(a, b)
	return (a ~= nil and a ~= "") and a or b
end
_m._a = function (x)
	if type(x) ~= "table" then return x end
	if x.args then return x.args[1] end
	return x[1]
end
return _m