Module:Item util

From Path of Exile 2 Wiki
Revision as of 00:04, 7 November 2021 by Vinifera7 (talk | contribs) (Created page with "------------------------------------------------------------------------------- -- -- Module:Item util -- -- This meta module contains utility f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Module documentation[view] [edit] [history] [purge]


This is a meta module.

This module is meant to be used only by other modules. It should not be invoked in wikitext.

Lua logo

This module depends on the following other modules:

This meta module provides utility functions for modules that deal with items.

Usage

This module should be loaded with require().

-------------------------------------------------------------------------------
-- 
--                              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