Title: Implementing DeepMerge · Issue #12769 · microsoft/TypeScript · GitHub
Open Graph Title: Implementing DeepMerge · Issue #12769 · microsoft/TypeScript
X Title: Implementing DeepMerge · Issue #12769 · microsoft/TypeScript
Description: Hello and good job on the mapped types! Though it seems recursive mapped types didn't get as much love. Is there any way to write the signature of update so that the following can be true? I run into either too permissive behaviors (I ca...
Open Graph Description: Hello and good job on the mapped types! Though it seems recursive mapped types didn't get as much love. Is there any way to write the signature of update so that the following can be true? I run in...
X Description: Hello and good job on the mapped types! Though it seems recursive mapped types didn't get as much love. Is there any way to write the signature of update so that the following can be true? I ru...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/12769
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implementing DeepMerge","articleBody":"Hello and good job on the mapped types!\r\n\r\nThough it seems recursive mapped types didn't get as much love.\r\n\r\nIs there any way to write the signature of `update` so that the following can be true?\r\n\r\nI run into either too permissive behaviors (I can add keys that are not in the original object, or set a non nullable key to undefined) or inferFromTypes: Maximum call stack size exceeded.\r\n\r\n```ts\r\n/*\r\n * SHOULD COMPILE\r\n */\r\n\r\nupdate({ a: 33 }, { a: 44 })\r\n\r\ntype A = { a?: number }\r\nupdate({ a: 33 } as A, { a: undefined })\r\n\r\nupdate(\r\n { a: { b: [1] }, c: 33, d: '44' },\r\n { a: { b: [1, 2] }, d: '66' }\r\n)\r\n\r\n\r\n\r\n /*\r\n * SHOULD NOT COMPILE\r\n */\r\n\r\nupdate({ a: 33 }, { a: undefined })\r\n\r\nupdate({ a: 33 }, { b: 44 })\r\n\r\nupdate({ a: 33 }, { a: '33' })\r\n\r\nupdate({ a: { b: [1] } }, { a: { b: ['2'] } })\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/AlexGalays","@type":"Person","name":"AlexGalays"},"datePublished":"2016-12-08T17:27:16Z","url":"https://github.com/microsoft/TypeScript/issues/12769"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:b0975065-49a3-3dd9-230d-06b471e0a9c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB18:1AE20C:43CB76:5768A2:6B00D527 |
| html-safe-nonce | e35257b0fc8862ac206ec6af05364de8df81fc9107c170bc30995602207fd4c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjE4OjFBRTIwQzo0M0NCNzY6NTc2OEEyOjZCMDBENTI3IiwidmlzaXRvcl9pZCI6IjUxMTUyNTA3NTc5MjIyNDc5NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74d7084f7f514754df8675d42f937223e5338c0f65a94c14cfaf397bcee2dbfb |
| hovercard-subject-tag | issue:194396050 |
| 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/12769/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f74694aa4b46068397291bbf1f06393e6ee0d26c58b165095f5656b8c75f272/microsoft/TypeScript/issues/12769 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f74694aa4b46068397291bbf1f06393e6ee0d26c58b165095f5656b8c75f272/microsoft/TypeScript/issues/12769 |
| og:image:alt | Hello and good job on the mapped types! Though it seems recursive mapped types didn't get as much love. Is there any way to write the signature of update so that the following can be true? I run in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexGalays |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width