This is the documentation page for Module:Shared
Shared contains useful utilities, including extensions of STL libraries.
On this Wiki, Shared is used in:
Usage
Module
local p = {}
local shared = require('Module:Shared')
local function func(input)
-- ...
for i, v in shared.skpairs(table) do
-- ...
end
-- ...
end
Documentation
Package items
shared.getArgs(frame, options)(function)- For getting frame or parent arguments.
- Parameters:
frameThe input arguments (table)optionsOptions for getting the args (table)
- Returns: The arguments (table)
shared.upk(v)(function)- Reversable table-to-string conversion
- Parameter:
v(any) - Returns: (string)
shared.Cache(s)(function)- Parameter:
s(string) - Returns: (string)
shared.assert(cond, message, layer)(function)- A replacement
assertfor blaming other places in the call stack - Parameters:
condThe condition under which to not throw the error, passes through (bool)messageThe error message (string)layerThe layer whose fault the error is, 1 being the line calling this function (int)
- Returns: cond (any)
shared.assertType(cond, tipe, message)(function)- An alternative
assertfor checking the type of parameters - Parameters:
condThe value to be tested, passes through (any)tipeThe type the condition will be tested for (string)messageThe error message, defaults to a generic "Improper value" (string)
- Returns: cond (any)
shared.delayRequire(mdule, data)(function)- Delays the require()ment of a module until it is indexed (call to return main table)
- Parameters:
mduleThe module to require (string)dataWhether to use mw.loadData (boolean; optional)
- Returns: cond (any)
- Created with Docbunto
See Also