title: How to validate input like in React.propTypes for the input of custom functions?
body: <p>I really like to enforce/validate data based on the React style but I find very hard to decouple their classes from the library to be more generic. How I might do it? (Notice that is not form validation)</p>
  
  <p>I give an object to a function and I want that function to validate that input based on a "schema":</p>
  
  <pre class="lang-js prettyprint-override"><code> function(input){
        validate(input, {
             test: Validator.Number
        })
   }
  </code></pre>
  
  <p>Notice that it also enables nested arrays and objects validation. <a href="http://facebook.github.io/react/docs/reusable-components.html" rel="nofollow">http://facebook.github.io/react/docs/reusable-components.html</a></p>
  
  <p>I've tried <a href="https://github.com/molnarg/js-schema" rel="nofollow">https://github.com/molnarg/js-schema</a> but extends native objects <code>Number.min(0).max(5),</code></p>