Back to Type Challenges

README

questions/33763-hard-union-to-object-from-key/README.md

latest1.1 KB
Original Source
<!--info-header-start--><h1>Union to Object from key </h1><blockquote><p>by clen cat <a href="https://github.com/a145789" target="_blank">@a145789</a></p></blockquote><p><a href="https://tsch.js.org/33763/play" target="_blank"></a> </p><!--info-header-end-->

Find the object containing the key in the union type by the key. It takes two parameters: a union of object types and a key name.

<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/33763/answer" target="_blank"></a> <a href="https://tsch.js.org/33763/solutions" target="_blank"></a> <!--info-footer-end-->