The TypeCzech library will only check parameters when either 'THROW-EXCEPTIONS'
or 'LOG-ERRORS' is the command on initialization.
-
THROW-EXCEPTIONS causes errors to throw an exception and possibly halt
-
LOG-ERRORS causes parameter errors to be logged in the console
type_czech = TypeCzech('LOG-ERRORS')
type_czech = TypeCzech('THROW-EXCEPTIONS')
Two additional possible options are 'UNDEF-OK' and 'CONSOLE-COUNT'
-
UNDEF-OK accepts typeless null and undefined values when checking parameter type shapes
without any type errors. In other words null and undefined are like wild cards.
-
CONSOLE-COUNT will output a run count of parameter checking functions in Console so when
testing, can view if parameter tests are actually executing.
Option order is un-important, the below two examples produces the same output
type_czech=TypeCzech('LOG-ERRORS','UNDEF-OK','CONSOLE-COUNT')
type_czech=TypeCzech('UNDEF-OK','CONSOLE-COUNT','LOG-ERRORS')
Note that no parameter checking occurs with either of these two
type_czech = TypeCzech()
type_czech = TypeCzech('NO-CHECKING')
Thus parameter checking can be easily turned off when changing from development to production code.