FANDOM


-- Module Check
--
-- Written by [[User:Shining-Armor]]
--
-- Version 0.0.1
--
-- Last updated 9-15-2014
--<nowiki>
 
local p = {}
 
 
-- {{#invoke: Check|isMatch|Case Sensitive|arg1|arg2|ifTrue|ifFalse}}
--
-- {{#invoke: Check|isMatch|false|Cat|Dog|Animal is a cat|Animal is not a cat}} -> Animal is not a cat
function p.isMatch( frame )
    if frame.args[1] == 'true' then
        frame.args[2] = string.lower(frame.args[2])
        frame.args[3] = string.lower(frame.args[3])        
    end
 
    if frame.args[2] == frame.args[3] then
        return frame.args[4]
    else
        return frame.args[5]
    end
end
 
-- {{#invoke: Check|arg1}}
--
-- {{#invoke: Check|}} -> true
-- {{#invoke: Check|Cat}} -> false
function p.isNull( frame )
    if frame.args[1] == nil or frame.args[1] == '' then
        return true
    else
        return false
    end
end
 
-- {{#invoke: Check|arg1|default}}
--
-- {{#invoke: Check||Dog}} -> Dog
-- {{#invoke: Check|Cat|Dog}} -> Cat
function p.isNullDefault( frame )
    if frame.args[1] == nil or frame.args[1] == '' then
        return frame.args[2]
    else
        return frame.args[1]
    end
end
 
return p
--</nowiki>

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.