Kryzeth Standard Library

StdLib.Utils.Is.Methods

Shared predicate methods exposed through Is, Is.Not, Is.Assert, and Is.Assert.Not.

Methods83

function Methods.Table(var: any) -> any

Returns the var if the passed variable is a table.

Parameters
varany

The variable to check

Returns
any
function Methods.table(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.String(var: any) -> any

Returns the var if the passed variable is a string.

Parameters
varany

The variable to check

Returns
any
function Methods.string(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Number(var: any) -> any

Returns the var if the passed variable is a number.

Parameters
varany

The variable to check

Returns
any
function Methods.number(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Thread(var) -> false | thread
function Methods.thread(var) -> false | thread
function Methods.Userdata(var) -> false | userdata
function Methods.userdata(var) -> false | userdata
function Methods.Nil(var: any) -> boolean

Returns true if the passed variable is nil.

Parameters
varany

The variable to check

Returns
boolean
function Methods.is_nil(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean
function Methods.Boolean(var: any) -> boolean

Returns true if the passed variable is a boolean.

Parameters
varany

The variable to check

Returns
boolean
function Methods.True(var: any) -> boolean

Returns true if the passed variable is true

Parameters
varany

The variable to check

Returns
boolean
function Methods.is_true(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean
function Methods.Truthy(var: any) -> any

Returns the var if the passed variable is not nil or false.

Parameters
varany

The variable to check

Returns
any
function Methods.truthy(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.False(var: any) -> boolean

Returns true if the passed variable is false.

Parameters
varany

The variable to check

Returns
boolean
function Methods.is_false(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean
function Methods.Falsy(var: any) -> boolean

Returns true if the passed variable is false or nil.

Parameters
varany

The variable to check

Returns
boolean
function Methods.falsy(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean
function Methods.Empty(var: any) -> boolean

Returns true if the passed variable is nil, an empty table, or an empty string.

Parameters
varany

The variable to check

Returns
boolean
function Methods.empty(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean
function Methods.None(var) -> boolean
function Methods.none(var) -> boolean
function Methods.Positive(var: any) -> any

Returns the passed var if it is positive.

Parameters
varany

The variable to check

Returns
any
function Methods.positive(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.odd(var: any) -> any

Returns the passed var if it is odd.

Parameters
varany

The variable to check

Returns
any
function Methods.even(var: any) -> any

Returns the passed var if it is even.

Parameters
varany

The variable to check

Returns
any
function Methods.Negative(var: any) -> any

Returns the passed var if it is negative.

Parameters
varany

The variable to check

Returns
any
function Methods.negative(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.NaN(var: any) -> any

Returns the passed var if it is not a number.

Parameters
varany

The variable to check

Returns
any
function Methods.nan(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Finite(var: any) -> any

Returns the passed var if it is finite.

Parameters
varany

The variable to check

Returns
any
function Methods.finite(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Int(var: any) -> any

Returns the passed var if it is an int.

Parameters
varany

The variable to check

Returns
any
function Methods.int(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Int8(var: any) -> any

Returns the passed var if it is an int8.

Parameters
varany

The variable to check

Returns
any
function Methods.int8(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Int16(var: any) -> any

Returns the passed var if it is an int16.

Parameters
varany

The variable to check

Returns
any
function Methods.int16(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Int32(var: any) -> any

Returns the passed var if it is an int32.

Parameters
varany

The variable to check

Returns
any
function Methods.int32(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Unsigned(var: any) -> any

Returns the passed var if it is an unsigned int.

Parameters
varany

The variable to check

Returns
any
function Methods.unsigned(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.UInt(var: any) -> any

Returns the passed var if it is an unsigned int.

Parameters
varany

The variable to check

Returns
any
function Methods.uint(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.UInt8(var: any) -> any

Returns the passed var if it is an unsigned int8.

Parameters
varany

The variable to check

Returns
any
function Methods.uint8(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.UInt16(var: any) -> any

Returns the passed var if it is an unsigned int16.

Parameters
varany

The variable to check

Returns
any
function Methods.uint16(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.UInt32(var: any) -> any

Returns the passed var if it is an unsigned int32.

Parameters
varany

The variable to check

Returns
any
function Methods.uint32(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Float(var: any) -> any

Returns the passed var if it is a float.

Parameters
varany

The variable to check

Returns
any
function Methods.float(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Position(var: any) -> any

Returns the passed var if it is a full position.

Parameters
varany

The variable to check

Returns
any
function Methods.position(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Area(var: any) -> any

Returns the passed var if it is a full area.

Parameters
varany

The variable to check

Returns
any
function Methods.area(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Vector(var: any) -> any

Returns the passed var if it is a simple position/vector.

Parameters
varany

The variable to check

Returns
any
function Methods.vector(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.BoundingBox(var: any) -> any

Returns the passed var if it is a simple area/boundingbox.

Parameters
varany

The variable to check

Returns
any
function Methods.boundingbox(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.bounding_box(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Bounding_Box(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.Hex(var: any) -> any

Returns the hex value of the passed var if it is hexadecimal.

Parameters
varany

The variable to check

Returns
any
function Methods.hex(var: any) -> any
Parameters
varany

The variable to check

Returns
any
function Methods.StrictWord(var: any) -> boolean

Returns true if the passed variable is a single alphbetical word. Does not allow any special chars

Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.strict_word(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.AlphabetWord(var: any) -> boolean

Returns true if the passed variable is a single alphbetical word. Allows _ and - as part of the word

Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.Word(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.AlphanumWord(var: any) -> boolean

Returns true if the passed variable is a single alphbetical word. Must start with a letter, allows _ and - as part of the word

Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.Alpha(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.alpha(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.alphanumword(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a single alphbetical word

function Methods.Object(var: any) -> LuaObject | nil

Is this a factorio object

Parameters
varany

The variable to check

Returns
LuaObject | nil

the var if this is an LuaObject

function Methods.object(var: any) -> LuaObject | nil
Parameters
varany

The variable to check

Returns
LuaObject | nil

the var if this is an LuaObject

function Methods.Valid(var: any) -> any

Is this factorio object valid

Parameters
varany

The variable to check

Returns
any

the var if this is a valid LuaObject

function Methods.valid(var: any) -> any
Parameters
varany

The variable to check

Returns
any

the var if this is a valid LuaObject

function Methods.Callable(var: any) -> boolean

Returns true if the passed variable is a callable function.

Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a callable function

function Methods.callable(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a callable function

function Methods.Function(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a callable function

function Methods.is_function(var: any) -> boolean
Parameters
varany

The variable to check

Returns
boolean

true if the passed variable is a callable function

Fields1

Methods.boolean : any