Title: Change type of "typeof" to a string literal union · Issue #10594 · microsoft/TypeScript · GitHub
Open Graph Title: Change type of "typeof" to a string literal union · Issue #10594 · microsoft/TypeScript
X Title: Change type of "typeof" to a string literal union · Issue #10594 · microsoft/TypeScript
Description: if (typeof x === 'funciton') { // no error // oops... } Modern JS engines appear to no longer use the "implementation-dependent" possibility in their typeof implementations and only return the "known" values. We should just encode this i...
Open Graph Description: if (typeof x === 'funciton') { // no error // oops... } Modern JS engines appear to no longer use the "implementation-dependent" possibility in their typeof implementations and only return the "kno...
X Description: if (typeof x === 'funciton') { // no error // oops... } Modern JS engines appear to no longer use the "implementation-dependent" possibility in their typeof implementations and on...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/10594
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change type of \"typeof\" to a string literal union","articleBody":"``` ts\nif (typeof x === 'funciton') { // no error\n // oops...\n}\n```\n\nModern JS engines appear to no longer use the \"implementation-dependent\" possibility in their `typeof` implementations and only return the \"known\" values. We should just encode this information into the type of `typeof` expressions -- we'll catch far more bugs where type names get misspelled in exchange for a very small number of type assertions in code that runs on exotic/ancient runtimes.\n\nReference: http://stackoverflow.com/questions/8940772/does-the-javascript-typeof-operator-ever-return-an-upper-case-string\n","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2016-08-29T19:22:47Z","url":"https://github.com/microsoft/TypeScript/issues/10594"}
| 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:8ad18bc1-2fb8-c02b-bf8c-499234168d7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8F0:3CC073:4110047:56C4797:6B0408EF |
| html-safe-nonce | e2ed2a146b10fb6546a71f0faad252c34417f664192a24445faa0fd71a37a386 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEYwOjNDQzA3Mzo0MTEwMDQ3OjU2QzQ3OTc6NkIwNDA4RUYiLCJ2aXNpdG9yX2lkIjoiNzQ1MzUzOTYxMjI0MjQ3OTM0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 08637b2e49f396232bb4ca2df7226d3906d83c64c230abbdce160fd8d7f6e3f3 |
| hovercard-subject-tag | issue:173851101 |
| 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/10594/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4ab2dec325c118ee00c92c32cd5b39fed58c4cb8018972b1a5b934c5f7309952/microsoft/TypeScript/issues/10594 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4ab2dec325c118ee00c92c32cd5b39fed58c4cb8018972b1a5b934c5f7309952/microsoft/TypeScript/issues/10594 |
| og:image:alt | if (typeof x === 'funciton') { // no error // oops... } Modern JS engines appear to no longer use the "implementation-dependent" possibility in their typeof implementations and only return the "kno... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RyanCavanaugh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width