Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo(value: string | number | null): string | null {
- if (typeof value !== 'string' && value !== null) {
- throw new Error();
- }
- return value;
- }
- function bar(value: string | number): string {
- if (typeof value !== 'string') {
- throw new Error();
- }
- return value;
- }
Add Comment
Please, Sign In to add comment