-- <pre>
-- TODO: find better way using region endpoint.
local thisData = mw.loadData( 'Module:Data/static/medium/data' )
local regionData = 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', '' )
:gsub( 'yugioh', '' )
:gsub( 'cardgame', '' )
or nil
end
return function( v )
local normalizedV = normalize( v )
return thisData.main[
thisData.normalize[
regionData.normalize[
normalizedV
] or normalizedV
]
]
end
-- </pre>