Module:SMW Utils

From Brighter Shores Wiki
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:SMW Utils/doc. [edit]
Module:SMW Utils is required by Module:Infobox.

-- Helpers functions for SMW

local p = {}

--[[
	Returns a boolean, whether the provided string is a valid subobject name
	Invalid subobject names are: '', '0', and any string with a '.' in the first 5 characters
--]]
function p.valid_subobject_name(arg)
	if arg == '0' or arg == '' then
		return false
	end
	if mw.ustring.find(mw.ustring.sub(arg, 1, 5), '.', 1, true) then
		return false
	end
	return true
end

return p