title: Preserve type checking after transpiling flow/typescript
body: <p>Currently, if I compile a flow/typescript file from something like the following</p>
  
  <pre><code>// @flow
  
  function foo(x: number): string {
      if (x) {
          return String(x);
      }
      return "default string";
  }
  
  module.exports = foo;
  </code></pre>
  
  <p>to the following:</p>
  
  <pre><code>function foo(x        )         {
      if (x) {
          return String(x);
      }
      return "default string";
  }
  
  module.exports = foo;
  </code></pre>
  
  <p>My question is, does there exist a way to transpile the code down to something like following?</p>
  
  <pre><code>function foo(x) {
      // preserve typechecking
      if (typeof x !== "number")
          throw new Error(`Expected x to be of type &lt;number&gt; instead got &lt;${typeof x}&gt;!!!!`);
  
      if (x) {
          return String(x);
      }
      return "default string";
  }
  </code></pre>