func-name
A dynamically type safe, robust and flexible function name retrieve.
usage
var funcname= ; var {};var {}; console;// this_is_my_name console;// an empty string literal as a logical false // you can change the name returned for an anonymus functionfuncnameanonymusName= ':('; // or call nameAnonymus on funcname to set it, restricted to string typefuncname= ;console;// ? // or without argument to default to 'anonymus'funcname= ;console;// anonymus // for debugging you can enable error log on passing a non-function argumentfuncname // or pass your own debug helper/handlerfuncname;
change log
0.2.0
- added debug method to allow for showing log or use custom event handler in case of invalid input
- now returning the return value of the error handler for invalid input
- optimised the flow and added some more robustness
- updates this readme
license
MIT