Title: String case change methods should return intrinsic string manipulation types · Issue #44268 · microsoft/TypeScript · GitHub
Open Graph Title: String case change methods should return intrinsic string manipulation types · Issue #44268 · microsoft/TypeScript
X Title: String case change methods should return intrinsic string manipulation types · Issue #44268 · microsoft/TypeScript
Description: lib Update Request Configuration Check My compilation target is ES2018 and my lib is ["ES2016", "dom"]. Missing / Incorrect Imprecise Definitions At least toUpperCase and toLowerCase methods on String, maybe/probably also the Locale vers...
Open Graph Description: lib Update Request Configuration Check My compilation target is ES2018 and my lib is ["ES2016", "dom"]. Missing / Incorrect Imprecise Definitions At least toUpperCase and toLowerCase methods on Str...
X Description: lib Update Request Configuration Check My compilation target is ES2018 and my lib is ["ES2016", "dom"]. Missing / Incorrect Imprecise Definitions At least toUpperCase and toLowe...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/44268
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"String case change methods should return intrinsic string manipulation types","articleBody":"# lib Update Request\r\n\r\n## Configuration Check\r\n\r\nMy compilation *target* is `ES2018` and my *lib* is `[\"ES2016\", \"dom\"]`.\r\n\r\n## ~~Missing / Incorrect~~ Imprecise Definitions\r\n\r\nAt least `toUpperCase` and `toLowerCase` methods on `String`, maybe/probably also the `Locale` versions?\r\n\r\n## Sample Code\r\n\r\n````ts\r\ntype LittleT = \"t\" | \"tt\";\r\ntype BigT = Uppercase\u003cLittleT>;\r\ndeclare const smol: LittleT;\r\nconst big: BigT = smol.toUpperCase(); // err, string is not assignable to \"T\" | \"TT\r\n````\r\n\r\n## Documentation Link\r\n\r\nhttps://tc39.es/ecma262/#sec-string.prototype.tolowercase\r\n\r\n\r\n## Note\r\n\r\nI'm not sure about the `Locale` versions of these methods because I don't know what algorithm the \"intrinsic\" `Uppercase\u003cT>` / `Lowercase\u003cT>` helper types are required to follow. (Do we need separate `LocaleUppercase` / `LocaleLowercase` helpers?)\r\n\r\nAlso worth mentioning: I think what I'm looking for is a return type of e.g. `Uppercase\u003cthis>`, which shouldn't have an impact on non-literal string types because `Uppercase\u003cstring>` is just `string`.","author":{"url":"https://github.com/thw0rted","@type":"Person","name":"thw0rted"},"datePublished":"2021-05-26T12:53:43Z","url":"https://github.com/microsoft/TypeScript/issues/44268"}
| 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:c8fcdaad-5408-4a4e-5283-c5b2710f9111 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B76C:21AC3F:2D6E065:397ED68:6B019BAF |
| html-safe-nonce | 9054ce1e90e32929f939137de9c4e85cd9b19fe5c6a532d2eb239a97f33ee42f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzZDOjIxQUMzRjoyRDZFMDY1OjM5N0VENjg6NkIwMTlCQUYiLCJ2aXNpdG9yX2lkIjoiMTcwMjIzMDU5MTEyOTI2MTI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 37e1c84a6d1c90324e261625d9d7f04672ea1032a891673eee92f01a5db447b4 |
| hovercard-subject-tag | issue:902347176 |
| 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/44268/issue_layout |
| twitter:image | https://opengraph.githubassets.com/975fe1723a19812fe10d42471c562325c2b35ec2708b0faaecf619904b520d81/microsoft/TypeScript/issues/44268 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/975fe1723a19812fe10d42471c562325c2b35ec2708b0faaecf619904b520d81/microsoft/TypeScript/issues/44268 |
| og:image:alt | lib Update Request Configuration Check My compilation target is ES2018 and my lib is ["ES2016", "dom"]. Missing / Incorrect Imprecise Definitions At least toUpperCase and toLowerCase methods on Str... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thw0rted |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width