warframe

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:
  • frame The input arguments (table)
  • options Options 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 assert for blaming other places in the call stack
Parameters:
  • cond The condition under which to not throw the error, passes through (bool)
  • message The error message (string)
  • layer The 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 assert for checking the type of parameters
Parameters:
  • cond The value to be tested, passes through (any)
  • tipe The type the condition will be tested for (string)
  • message The 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:
  • mdule The module to require (string)
  • data Whether to use mw.loadData (boolean; optional)
Returns: cond (any)

Created with Docbunto

See Also


Code