I really like the idea of react proptypes and am wondering if they can be used to validate the input of any given function, not just the props being passed to a react component.
For example:
function doSomething (thing1, thing2) {
Proptypes.validate(arguments, [Proptypes.string, Proptypes.number]);
}
Is there a way of getting proptypes to do this?
Thanks!
validatewould do? You're not planning on using exceptions in your "purely functional code", are you? ಠ_ಠ