Module:Yesno and Module:Yesno/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
MusikAnimal (talk | contribs) Undid revision 948472533 by [[Special:Contributions/w>Vogone|w>Vogone]] ([[User talk:w>Vogone|talk]]) |
No edit summary |
||
Line 1: | Line 1: | ||
-- Function allowing for consistent treatment of boolean-like wikitext input. |
--- Function allowing for consistent treatment of boolean-like wikitext input. |
||
-- It works similarly to the template {{yesno}}. |
-- It works similarly to the template {{tl|yesno}}. |
||
-- |
|||
-- @module yesno |
|||
-- @alias yn |
|||
-- @param {string} val Value to test |
|||
-- @param {boolean} default Default boolean to return |
|||
-- @return true for "yes", "on", etc.; false for "no", "off", etc.; the default |
|||
-- value if not specified, and nil if the default parameter is not |
|||
-- specified |
|||
-- @release stable |
|||
return function (val, default) |
return function (val, default) |
||
Line 28: | Line 37: | ||
return false |
return false |
||
else |
else |
||
-- not specified, return default |
|||
return default |
return default |
||
end |
end |