Module:CheckWikidataID

Documentation for this module may be created at Module:CheckWikidataID/doc

Code

local p = {}
-- This checks whther the first unknown parameter represents a valid entity-id.
-- It returns the strings "true" or "false"
-- Change false to nil in line 6 to return "true" or "" (easier to test with #if:)
function p.checkValidity(frame)
	if (mw.wikibase.isValidEntityId(frame.args[1] or "")) then return true else return false end
end
return p