Y
Hacker News
new
|
ask
|
show
|
jobs
by
rideg
1373 days ago
You can use type guards for something similar:
https://www.typescriptlang.org/docs/handbook/advanced-types....
2 comments
brundolf
1373 days ago
What they were getting at is that you can't observe T itself, only values passed in as type T
link
323
1373 days ago
Keyword similar. I use type guards for other things (like typing JSON responses), but they can't solve this particular problem.
link