Module:Item util
This is a meta module.
This module is meant to be used only by other modules. It should not be invoked in wikitext.
This meta module provides utility functions for modules that deal with items.
Usage
This module should be loaded with require()
.
The above documentation is transcluded from Module:Item util/doc.
Editors can experiment in this module's sandbox and testcases pages.
Subpages of this module.
Editors can experiment in this module's sandbox and testcases pages.
Subpages of this module.
-------------------------------------------------------------------------------
--
-- Module:Item util
--
-- This meta module contains utility functions for modules that deal with items
-------------------------------------------------------------------------------
-- The cfg table contains all localisable strings and configuration, to make it
-- easier to port this module to another wiki.
local cfg = mw.loadData('Module:Item util/config')
local i18n = cfg.i18n
-- ----------------------------------------------------------------------------
-- Exported functions
-- ----------------------------------------------------------------------------
local m = {}
function m.get_item_namespaces(format)
-- Returns item namespaces from config as a table or as a comma-separated string
if format == 'list' then
return cfg.item_namespaces_list
end
return cfg.item_namespaces
end
return m