Type Checkers - MSUTeam/MSU GitHub Wiki

File path: scripts/config/msu/type_checkers.nut

requireXYZ

::MSU.requireXYZ( ... )
// ... is any number of any variable type

Does nothing if all passed arguments are of type XYZ.
Throws a ::MSU.Exception.InvalidType if they are not.

Current List

::MSU.requireString( ... )      // string
::MSU.requireInt( ... )         // integer
::MSU.requireArray( ... )       // array
::MSU.requireFloat( ... )       // float
::MSU.requireBool( ... )        // boolean
::MSU.requireTable( ... )       // table
::MSU.requireInstance( ... )    // instance
::MSU.requireInstanceOf( _class, ... )    // instance of _class
::MSU.requireFunction( ... )    // function

::MSU.requireType( _type, ... ) // _type

requireOneFromTypes

::MSU.requireOneFromTypes( _typeArray, ... )
// _typeArray is an array
// ... is any number of any variable type

Does nothing if all variables passed in ... are any one of the types in _typeArray.
Throws ::MSU.Exception.InvalidType if they are not.

requireAnyTypeExcept

::MSU.requireAnyTypeExcept( _typeArray, ... )
// _typeArray is an array,
// ... is any number of any variable type

Does nothing if all variables passed in ... are not any of the types in _typeArray.
Throws ::MSU.Exception.InvalidType if they are.

⚠️ **GitHub.com Fallback** ⚠️