Title: Mapped conditional types · Issue #12424 · microsoft/TypeScript · GitHub
Open Graph Title: Mapped conditional types · Issue #12424 · microsoft/TypeScript
X Title: Mapped conditional types · Issue #12424 · microsoft/TypeScript
Description: #12114 added mapped types, including recursive mapped types. But as pointed out by @ahejlsberg Note, however, that such types aren't particularly useful without some form of conditional type that makes it possible to limit the recursion ...
Open Graph Description: #12114 added mapped types, including recursive mapped types. But as pointed out by @ahejlsberg Note, however, that such types aren't particularly useful without some form of conditional type that m...
X Description: #12114 added mapped types, including recursive mapped types. But as pointed out by @ahejlsberg Note, however, that such types aren't particularly useful without some form of conditional type th...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/12424
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mapped conditional types","articleBody":"#12114 added mapped types, including recursive mapped types. [But as pointed out by @ahejlsberg](https://github.com/Microsoft/TypeScript/pull/12114#issuecomment-259776847)\r\n\u003e Note, however, that such types aren't particularly useful without some form of conditional type that makes it possible to limit the recursion to selected kinds of types.\r\n```ts\r\ntype primitive = string | number | boolean | undefined | null;\r\ntype DeepReadonly\u003cT\u003e = T extends primitive ? T : DeepReadonlyObject\u003cT\u003e;\r\ntype DeepReadonlyObject\u003cT\u003e = {\r\n readonly [P in keyof T]: DeepReadonly\u003cT[P]\u003e;\r\n};\r\n```\r\nI couldn't find an existing issue with a feature request.\r\n\r\nConditional mapping would greatly improve the ergonomics of libraries like Immutable.js.\r\n","author":{"url":"https://github.com/matt-hensley","@type":"Person","name":"matt-hensley"},"datePublished":"2016-11-21T21:08:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":62},"url":"https://github.com/12424/TypeScript/issues/12424"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:98777fa2-b31d-68f7-f01f-5d61eb0fabfb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED40:2293D:A7F324:F202EF:6A621A21 |
| html-safe-nonce | 77c0d8ab35b0cb4c886b05108a50652b48e651a28f8307d5927228f46d33986e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDQwOjIyOTNEOkE3RjMyNDpGMjAyRUY6NkE2MjFBMjEiLCJ2aXNpdG9yX2lkIjoiNzY4MzU1MzE1ODM4NTI0NDcwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a22d3dcb36746be87b1daa76c344923e68f7d95174bc512228446d9a38757230 |
| hovercard-subject-tag | issue:190836133 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/12424/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec6604c0bdce6b7c8c9583460797a19863ae63a0cab34108ac9c1224f7803400/microsoft/TypeScript/issues/12424 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec6604c0bdce6b7c8c9583460797a19863ae63a0cab34108ac9c1224f7803400/microsoft/TypeScript/issues/12424 |
| og:image:alt | #12114 added mapped types, including recursive mapped types. But as pointed out by @ahejlsberg Note, however, that such types aren't particularly useful without some form of conditional type that m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matt-hensley |
| hostname | github.com |
| expected-hostname | github.com |
| None | ccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a7585b3d2ee639495a70ce464d0a18bad88ea12c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width