replace `readlink -f` for OSX
add function.isFunction()