-
Notifications
You must be signed in to change notification settings - Fork 4
Type Checkers
Enduriel edited this page May 5, 2022
·
3 revisions
File path: scripts/config/msu/type_checkers.nut
::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.
::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
::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.
::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.
- NOTE: MSU guarantees backwards compatibility for documented features and code only. Undocumented features/code of MSU may be changed at any time without notice, so we advise against using/referencing such code in your projects.
- For bug reports or feature requests, please create issues.
- If you would like to join the team, write to us at msu.team@protonmail.com.