hypixel skyblock
Lock
Page Protected from Editing
This page is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, it is subject to Page Protection.

Submodules

No submodules found for this page. Try purging the page or viewing all subpages.


See Also

Hypixel SkyBlock Wiki Standard Lua Libraries (hsw/stdll) v · d · e
Type Libraries
Module Loading Utilities
General Utilities
  • Module:LibraryUtil (Version that pushes all exports to _G)
  • Module:LibU (Version that does not inject things into _G)
Meta Modules
Object-oriented
Caching
Module:LibraryUtil/doc

Module Code

---------------------------------------------------------------------------------
-- From MediaWiki source file
-- and https://hypixel-skyblock.fandom.com/wiki/Module:LibraryUtil
-- 
-- On import, this script exposes all functions to the global table (_G)
-- so that the following functions are accessible everywhere solely through the function name:
-- function: getCodeLocation(level)
-- function: makeArgNumber(val)
-- function: getParentName(level) [alias: getStackName]
-- function: typeMatches(valType, val, types, nilOk, numberOk)
-- function: generateMsg(name, index, msg, types)
-- function: validateTypes(types)
-- function: checkType(name?: string, pos: number, value: any, types: string|table, nilOk?: boolean)
-- function: checkType(name: 'no value', pos: number, types?: string|table, level?: number)
-- function: checkTypeLight(name, argIdx, arg, expectTypes, nilOk)
-- function: checkArgs(types: table<table<string> | string>, ...arguments?: any) [alias: checkTypeArgs]
-- function: checkTypeMulti(t, types)
-- function: alertDeprecation(name: string, useInstead?: string, level?: number)
-- function: forEachArgs(types: string, ...arguments?: string)
-- function: makeCheckSelfFunction(libraryName: string, varName: string, selfObj?: table, selfObjDesc?: string)
-- function: formattedError(formatStr?: string, level?: number, ...substitions?: string | number)
-- function: formattedAssert(v?: any, formatStr?: string, level?: number, ...substitions?: string | number) [alias: assertTrue]
-- function: assertFalse(v, formatStr, level, ...)
-- function: existsWithoutWanted(title: string) [alias: mw.title.existsWithoutWanted]
-- function: inexpensivePageExists(title: string) [alias: pageExists]
-- function: pipeline(...)
-- function: bind(targetFn: function, ...items?: any)
-- 
-- The following methods are modified to a custom one:
-- function: mw.log(...)
-- function: mw.logObject(...)
-- function: mw.oldLog(...)
-- function: mw.oldLogObject(...)
---------------------------------------------------------------------------------
local libU = require('Module:LibU')

-- Push methods into global table
-- Please refer to Module:LibU for impmlementation
for _, v in ipairs({
	'getCodeLocation',
	'makeArgNumber',
	'getParentName',
	'typeMatches',
	'generateMsg',
	'validateTypes',
	'checkType',
	'checkTypeLight',
	'checkArgs',
	'checkTypeMulti',
	'alertDeprecation',
	'forEachArgs',
	'makeCheckSelfFunction',
	'formattedError',
	'formattedAssert',
	'assertFalse',
	'existsWithoutWanted',
	'inexpensivePageExists',
	'pipeline',
	'bind',
	'getStackName',
	'checkTypeArgs',
	'assertTrue',
	'pageExists',
}) do
	_G[v] = libU[v]
end

return libU