Note: the above functions will fail if passed input that is not of type . This might be the case if you use the function in the main function of your module, and that function is called by another Lua module. In this case, you will need to check the type of your input. This is not a problem if you are using a function specially for arguments from #invoke (i.e. you have and functions, or something similar).