Type checking functions based on underscore.js