SHARE
TWEET

Untitled

a guest Jan 11th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function foo(value: string | number | null): string | null {
  2.     if (typeof value !== 'string' && value !== null) {
  3.         throw new Error();
  4.     }
  5.  
  6.     return value;
  7. }
  8.  
  9. function bar(value: string | number): string {
  10.     if (typeof value !== 'string') {
  11.         throw new Error();
  12.     }
  13.  
  14.     return value;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top