Typed.js is a function-wrapping utility that will check argument types prior to invoking a function. This is designed to make it easy to add type checking to existing functions: You only have to update the signature.