Module:Data/static/region

From Yugipedia
< Module:Data
Revision as of 01:46, 23 December 2019 by Becasita (talk | contribs) (Fix typo.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Module documentation[create]
-- <pre>
local thisData = mw.loadData( 'Module:Data/static/region/data' )

local function normalize( v )
	return type( v ) == 'string'
		and mw.text.trim( v )
			:lower()
			:gsub( "[%s%-_'!]", '' )
			:gsub(     'north', '' )
		or nil
end

return function( v )
	return thisData.main[
		thisData.normalize[
			normalize( v )
		]
	]
end
-- </pre>