Guest User

Untitled

a guest
Jan 11th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment