My coworker and I were playing around with a utility this week, and while we got a working solution, I wasn't satisfied with use of an explicit string literal key in its composition. Is it possible to narrow types here, with or without a type assertion?
I've posted the working first attempt, and my failing second attempt in a public gist here: https://gist.github.com/broguinn/209129b7a18134571497334b1993abe7
Edit: Typescript Playground link.
Apologies if this isn't the best format to share code snippets - it's my first post here. Thanks for your help.