Title: Some way to express a non-null / non-undefined any would be nice · Issue #7648 · microsoft/TypeScript · GitHub
Open Graph Title: Some way to express a non-null / non-undefined any would be nice · Issue #7648 · microsoft/TypeScript
X Title: Some way to express a non-null / non-undefined any would be nice · Issue #7648 · microsoft/TypeScript
Description: While updating the various .d.ts to have | null and | undefined, I came across some typings that use any but don't allow null or undefined. Object.defineProperty: /** * Adds a property to an object, or modifies attributes of an existing ...
Open Graph Description: While updating the various .d.ts to have | null and | undefined, I came across some typings that use any but don't allow null or undefined. Object.defineProperty: /** * Adds a property to an object...
X Description: While updating the various .d.ts to have | null and | undefined, I came across some typings that use any but don't allow null or undefined. Object.defineProperty: /** * Adds a property to an ob...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7648
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Some way to express a non-null / non-undefined any would be nice","articleBody":"While updating the various .d.ts to have `| null` and `| undefined`, I came across some typings that use `any` but don't allow `null` or `undefined`.\n- Object.defineProperty:\n \n ``` typescript\n /**\n * Adds a property to an object, or modifies attributes of an existing property. \n * @param o Object on which to add or modify the property. This can be a native JavaScript \n * object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor\n * property.\n */\n defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;\n ```\n \n `o` and the returned value cannot be `null` or `undefined`.\n- Object.setPrototypeOf:\n \n ``` typescript\n /**\n * Sets the prototype of a specified object o to object proto or null. Returns the object o.\n * @param o The object to change its prototype.\n * @param proto The value of the new prototype or null.\n */\n setPrototypeOf(o: any, proto: any): any;\n ```\n \n `o` and the returned value cannot be `null` or `undefined`. `proto` can be `null` but not `undefined`.\n- etc.\n\nI think there is value in being able to express both \"This can be any type including null and undefined\" and \"This can be any type excluding null / undefined\", but there is no way to express the latter.\n","author":{"url":"https://github.com/Arnavion","@type":"Person","name":"Arnavion"},"datePublished":"2016-03-23T01:16:05Z","url":"https://github.com/microsoft/TypeScript/issues/7648"}
| 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:1b599dc8-9486-2b08-969b-de0a6ee9e372 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D91C:28815B:7C67B7:A7EF65:6B00DEA3 |
| html-safe-nonce | 788d95ccb4cb2274fcd164810e1d0b6c34f3b073e198a8c258674efb6b5e376a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTFDOjI4ODE1Qjo3QzY3Qjc6QTdFRjY1OjZCMDBERUEzIiwidmlzaXRvcl9pZCI6IjQzODQwNDIzOTgzNjg0NTYzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | da0d01fce5f8dfd96bb44e24b5921a8e797e76d61515f2babefd8e3cf0c3fa02 |
| hovercard-subject-tag | issue:142825820 |
| 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/7648/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd115aec11a6c9e77d85d81fba170a06760ffd0af4a0c94a20de78b672f663a5/microsoft/TypeScript/issues/7648 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd115aec11a6c9e77d85d81fba170a06760ffd0af4a0c94a20de78b672f663a5/microsoft/TypeScript/issues/7648 |
| og:image:alt | While updating the various .d.ts to have | null and | undefined, I came across some typings that use any but don't allow null or undefined. Object.defineProperty: /** * Adds a property to an object... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Arnavion |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width