Module:Adjacent stations: Difference between revisions

Content deleted Content added
No edit summary
Cease reinventing the wheel
Line 2:
-- It works similarly to the template {{yesno}}.
 
local function yesno(val, default= require("Module:Yesno")
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
 
local _style = {