<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.p1gsel.com/p1gwars/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fsandbox</id>
	<title>Module:Yesno/sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.p1gsel.com/p1gwars/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://www.p1gsel.com/p1gwars/index.php?title=Module:Yesno/sandbox&amp;action=history"/>
	<updated>2026-04-17T06:48:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.p1gsel.com/p1gwars/index.php?title=Module:Yesno/sandbox&amp;diff=6190&amp;oldid=prev</id>
		<title>Rosie: Created page with &quot;--- Allows for consistent treatment of boolean-like wikitext input. --- Uses lookup table, instead of if-elseif-else statement, for efficiency. -- -- If your wiki uses non-ASCII characters for any of &quot;yes&quot;, &quot;no&quot;, etc., you -- should replace &quot;string.lower&quot; with &quot;mw.ustring.lower&quot; in the -- following line. NOTE: It is _much_ slower. local LOWER = string.lower local TO_NUMBER = tonumber local TYPE = type local BOOLEAN_MAP = {     yes = true, y = true, [&#039;true&#039;] = true, t = t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.p1gsel.com/p1gwars/index.php?title=Module:Yesno/sandbox&amp;diff=6190&amp;oldid=prev"/>
		<updated>2026-01-11T14:08:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--- Allows for consistent treatment of boolean-like wikitext input. --- Uses lookup table, instead of if-elseif-else statement, for efficiency. -- -- If your wiki uses non-ASCII characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you -- should replace &amp;quot;string.lower&amp;quot; with &amp;quot;mw.ustring.lower&amp;quot; in the -- following line. NOTE: It is _much_ slower. local LOWER = string.lower local TO_NUMBER = tonumber local TYPE = type local BOOLEAN_MAP = {     yes = true, y = true, [&amp;#039;true&amp;#039;] = true, t = t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--- Allows for consistent treatment of boolean-like wikitext input.&lt;br /&gt;
--- Uses lookup table, instead of if-elseif-else statement, for efficiency.&lt;br /&gt;
--&lt;br /&gt;
-- If your wiki uses non-ASCII characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you&lt;br /&gt;
-- should replace &amp;quot;string.lower&amp;quot; with &amp;quot;mw.ustring.lower&amp;quot; in the&lt;br /&gt;
-- following line. NOTE: It is _much_ slower.&lt;br /&gt;
local LOWER = string.lower&lt;br /&gt;
local TO_NUMBER = tonumber&lt;br /&gt;
local TYPE = type&lt;br /&gt;
local BOOLEAN_MAP = {&lt;br /&gt;
    yes = true, y = true, [&amp;#039;true&amp;#039;] = true, t = true, on = true, [&amp;#039;1&amp;#039;] = true,&lt;br /&gt;
    no = false, n = false, [&amp;#039;false&amp;#039;] = false, f = false, off = false, [&amp;#039;0&amp;#039;] = false&lt;br /&gt;
}&lt;br /&gt;
return function (value, defaultResponse)&lt;br /&gt;
    if value == nil then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local valueType = TYPE(value)&lt;br /&gt;
&lt;br /&gt;
    if valueType == &amp;#039;boolean&amp;#039; then&lt;br /&gt;
        return value&lt;br /&gt;
    elseif valueType == &amp;#039;string&amp;#039; then&lt;br /&gt;
        local lookupResult = BOOLEAN_MAP[LOWER(value)]&lt;br /&gt;
        if lookupResult ~= nil then&lt;br /&gt;
            return lookupResult&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Numeric check works for both numbers and numeric strings.&lt;br /&gt;
    local number = TO_NUMBER(value)&lt;br /&gt;
    if number == 1 then&lt;br /&gt;
        return true&lt;br /&gt;
    elseif number == 0 then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return defaultResponse&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Rosie</name></author>
	</entry>
</feed>