Exercise #156: Medium Chainable Options
Type Challenges (Utility Types) ยท 03-medium
Goal

Goal: Chainable options are commonly used in JavaScript. But when we switch to TypeScript, can you properly type it? In this challenge, you need to type an object or a class - whatever you like - to provide two functions `option(key, value)` and `get()`. In `option(key, value)`, you can extend the current config type by the given key and value. We should about to access the final result via `get()`. For example: You don't need to write any JS/TS logic to handle the problem - just in type level. You can assume that `key` only accept `string` and the `value` can be anything - just leave it as-is. Same `key` won't be passed twice. Source challenge: https://github.com/type-challenges/type-challenges/tree/main/questions/00012-medium-chainable-options Reference explanation: https://github.com/ghaiklor/type-challenges-solutions/blob/main/en/medium-chainable-options.md

Run "Check Solution" to validate your code in the browser.