<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ffxivroleplay.koisaquarium.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALibraryUtil</id>
	<title>Module:LibraryUtil - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ffxivroleplay.koisaquarium.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALibraryUtil"/>
	<link rel="alternate" type="text/html" href="http://ffxivroleplay.koisaquarium.com/index.php?title=Module:LibraryUtil&amp;action=history"/>
	<updated>2026-04-22T01:12:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>http://ffxivroleplay.koisaquarium.com/index.php?title=Module:LibraryUtil&amp;diff=1168&amp;oldid=prev</id>
		<title>Feelingkoi: Created page with &quot;-- &lt;nowiki&gt; local libraryUtil = require( &#039;libraryUtil&#039; )  -- libraryUtil is a standard scribunto module, the following commented out code is just to show what is inside it. Documentation about these functions can be found at https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#libraryUtil --[=[ local libraryUtil = {}  function libraryUtil.checkType( name, argIdx, arg, expectType, nilOk ) 	if arg == nil and nilOk then 		return 	end 	if type( arg ) ~= ex...&quot;</title>
		<link rel="alternate" type="text/html" href="http://ffxivroleplay.koisaquarium.com/index.php?title=Module:LibraryUtil&amp;diff=1168&amp;oldid=prev"/>
		<updated>2023-06-15T13:35:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;nowiki&amp;gt; local libraryUtil = require( &amp;#039;libraryUtil&amp;#039; )  -- libraryUtil is a standard scribunto module, the following commented out code is just to show what is inside it. Documentation about these functions can be found at https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#libraryUtil --[=[ local libraryUtil = {}  function libraryUtil.checkType( name, argIdx, arg, expectType, nilOk ) 	if arg == nil and nilOk then 		return 	end 	if type( arg ) ~= ex...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
local libraryUtil = require( &amp;#039;libraryUtil&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
-- libraryUtil is a standard scribunto module, the following commented out code is just to show what is inside it. Documentation about these functions can be found at https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#libraryUtil&lt;br /&gt;
--[=[&lt;br /&gt;
local libraryUtil = {}&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.checkType( name, argIdx, arg, expectType, nilOk )&lt;br /&gt;
	if arg == nil and nilOk then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	if type( arg ) ~= expectType then&lt;br /&gt;
		local msg = string.format( &amp;quot;bad argument #%d to &amp;#039;%s&amp;#039; (%s expected, got %s)&amp;quot;,&lt;br /&gt;
			argIdx, name, expectType, type( arg )&lt;br /&gt;
		)&lt;br /&gt;
		error( msg, 3 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.checkTypeMulti( name, argIdx, arg, expectTypes )&lt;br /&gt;
	local argType = type( arg )&lt;br /&gt;
	for _, expectType in ipairs( expectTypes ) do&lt;br /&gt;
		if argType == expectType then&lt;br /&gt;
			return&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local n = #expectTypes&lt;br /&gt;
	local typeList&lt;br /&gt;
	if n &amp;gt; 1 then&lt;br /&gt;
		typeList = table.concat( expectTypes, &amp;#039;, &amp;#039;, 1, n - 1 ) .. &amp;#039; or &amp;#039; .. expectTypes[n]&lt;br /&gt;
	else&lt;br /&gt;
		typeList = expectTypes[1]&lt;br /&gt;
	end&lt;br /&gt;
	local msg = string.format( &amp;quot;bad argument #%d to &amp;#039;%s&amp;#039; (%s expected, got %s)&amp;quot;,&lt;br /&gt;
		argIdx,&lt;br /&gt;
		name,&lt;br /&gt;
		typeList,&lt;br /&gt;
		type( arg )&lt;br /&gt;
	)&lt;br /&gt;
	error( msg, 3 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.checkTypeForIndex( index, value, expectType )&lt;br /&gt;
	if type( value ) ~= expectType then&lt;br /&gt;
		local msg = string.format( &amp;quot;value for index &amp;#039;%s&amp;#039; must be %s, %s given&amp;quot;,&lt;br /&gt;
			index, expectType, type( value )&lt;br /&gt;
		)&lt;br /&gt;
		error( msg, 3 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.checkTypeForNamedArg( name, argName, arg, expectType, nilOk )&lt;br /&gt;
	if arg == nil and nilOk then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	if type( arg ) ~= expectType then&lt;br /&gt;
		local msg = string.format( &amp;quot;bad named argument %s to &amp;#039;%s&amp;#039; (%s expected, got %s)&amp;quot;,&lt;br /&gt;
			argName, name, expectType, type( arg )&lt;br /&gt;
		)&lt;br /&gt;
		error( msg, 3 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.makeCheckSelfFunction( libraryName, varName, selfObj, selfObjDesc )&lt;br /&gt;
	return function ( self, method )&lt;br /&gt;
		if self ~= selfObj then&lt;br /&gt;
			error( string.format(&lt;br /&gt;
				&amp;quot;%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. &amp;quot; ..&lt;br /&gt;
				&amp;quot;%s.%s() instead of %s:%s()?&amp;quot;,&lt;br /&gt;
				libraryName, selfObjDesc, method, varName, method, varName, method&lt;br /&gt;
			), 3 )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
function libraryUtil.makeCheckClassFunction( libraryName, varName, class, selfObjDesc )&lt;br /&gt;
	return function ( self, method )&lt;br /&gt;
		if getmetatable( self ) ~= class then&lt;br /&gt;
			error( string.format(&lt;br /&gt;
				&amp;quot;%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. &amp;quot; ..&lt;br /&gt;
				&amp;quot;%s.%s() instead of %s:%s()?&amp;quot;,&lt;br /&gt;
				libraryName, selfObjDesc, method, varName, method, varName, method&lt;br /&gt;
			), 3 )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return libraryUtil&lt;br /&gt;
-- &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Feelingkoi</name></author>
	</entry>
</feed>