René's URL Explorer Experiment


Title: Suggestion: Add the nameof compile-time operator to convert property and function names into strings · Issue #1579 · microsoft/TypeScript · GitHub

Open Graph Title: Suggestion: Add the nameof compile-time operator to convert property and function names into strings · Issue #1579 · microsoft/TypeScript

X Title: Suggestion: Add the nameof compile-time operator to convert property and function names into strings · Issue #1579 · microsoft/TypeScript

Description: I would like to see the nameof operator be considered for Typescript. This feature was just added to C# description, and it is an elegant solution to a common issue in Javascript. At compile time, nameof converts its parameter (if valid)...

Open Graph Description: I would like to see the nameof operator be considered for Typescript. This feature was just added to C# description, and it is an elegant solution to a common issue in Javascript. At compile time, ...

X Description: I would like to see the nameof operator be considered for Typescript. This feature was just added to C# description, and it is an elegant solution to a common issue in Javascript. At compile time, ...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/1579

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: Add the nameof compile-time operator to convert property and function names into strings","articleBody":"I would like to see the `nameof` operator be considered for Typescript.\n\nThis feature was just added to C# [description](http://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx), and it is an elegant solution to a common issue in Javascript.\n\nAt compile time, `nameof` converts its parameter (if valid), into a string. It makes it much easier to reason about \"magic strings\" that need to match variable or property names across refactors, prevent spelling mistakes, and other type-safe features.\n\nTo quote from the linked C# article:\n\n> Using ordinary string literals for this purpose is simple, but error prone. You may spell it wrong, or a refactoring may leave it stale. nameof expressions are essentially a fancy kind of string literal where the compiler checks that you have something of the given name, and Visual Studio knows what it refers to, so navigation and refactoring will work:\n\n`(if x == null) throw new ArgumentNullException(nameof(x));`\n\nTo show another example, imagine you have this Person class:\n\n```\nclass Person {\n    firstName: string\n    lastName: string\n}\nvar instance : Person = new Person();\n```\n\nIf I have an API that requires me to specify a property name by string (pretty common in JS), I am forced to do something like this:\n\n```\n   someFunction(personInstance, \"firstName\");\n```\n\nBut if I misspell `firstName`, I'll get a runtime error.\nSo this is the type-safe equivalent: \n\n```\n   someFunction(personInstance, nameof(Person.firstName));\n```\n","author":{"url":"https://github.com/Taytay","@type":"Person","name":"Taytay"},"datePublished":"2014-12-30T22:17:37Z","url":"https://github.com/microsoft/TypeScript/issues/1579"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9746d5b8-16fc-968b-a791-5d8533e4ceba
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAF2A:2454CC:67CBE5:85E31C:6B00E128
html-safe-noncebe7dded50835500e5716db136877abe4c0263f9893dac58dfe6a8bf4a5aeb487
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjJBOjI0NTRDQzo2N0NCRTU6ODVFMzFDOjZCMDBFMTI4IiwidmlzaXRvcl9pZCI6IjI0MjY0ODM1MjcwNDc1MDQxNjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf0b8113c2d5ae37c9f4dfc66a385ca882c0c93387325befb1c713b65fe2dfe7a
hovercard-subject-tagissue:53151928
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/1579/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c07fa65fe5809f871e216ab8f002294d0c6fa849636788310ee902072496edf2/microsoft/TypeScript/issues/1579
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c07fa65fe5809f871e216ab8f002294d0c6fa849636788310ee902072496edf2/microsoft/TypeScript/issues/1579
og:image:altI would like to see the nameof operator be considered for Typescript. This feature was just added to C# description, and it is an elegant solution to a common issue in Javascript. At compile time, ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameTaytay
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/1579#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F1579
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F1579
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/1579
Reloadhttps://github.com/microsoft/TypeScript/issues/1579
Reloadhttps://github.com/microsoft/TypeScript/issues/1579
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/1579
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/1579
Suggestion: Add the nameof compile-time operator to convert property and function names into stringshttps://github.com/microsoft/TypeScript/issues/1579#top
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Waiting for TC39Unactionable until TC39 reaches some conclusionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%20TC39%22
https://github.com/Taytay
Taylor Brown (Taytay)https://github.com/Taytay
on Dec 30, 2014https://github.com/microsoft/TypeScript/issues/1579#issue-53151928
descriptionhttp://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx
Nexthttps://github.com/microsoft/TypeScript/issues/1579?timeline_page=1
https://github.com/NoelAbrahams
Noel Abrahams (NoelAbrahams)https://github.com/NoelAbrahams
on Dec 31, 2014https://github.com/microsoft/TypeScript/issues/1579#issuecomment-68433262
#394https://github.com/microsoft/TypeScript/issues/394
#1003https://github.com/microsoft/TypeScript/issues/1003
https://github.com/danquirk
Dan Quirk (danquirk)https://github.com/danquirk
on Jan 6, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-68805585
Dan Quirk (danquirk)https://github.com/danquirk
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 6, 2015https://github.com/microsoft/TypeScript/issues/1579#event-214425744
Dan Quirk (danquirk)https://github.com/danquirk
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
on Jan 6, 2015https://github.com/microsoft/TypeScript/issues/1579#event-214425764
https://github.com/Bobris
Boris Letocha (Bobris)https://github.com/Bobris
on Jul 27, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-125344112
https://github.com/frodegil
Frode Gilberg (frodegil)https://github.com/frodegil
on Jul 28, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-125548479
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
on Jul 28, 2015https://github.com/microsoft/TypeScript/issues/1579#event-367453319
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 28, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-125677670
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 28, 2015https://github.com/microsoft/TypeScript/issues/1579#event-367453483
https://github.com/bryanerayner
Bryan Rayner (bryanerayner)https://github.com/bryanerayner
on Aug 19, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-132411418
https://github.com/bryanerayner
Bryan Rayner (bryanerayner)https://github.com/bryanerayner
on Aug 19, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-132411932
Frode Gilberg (@frodegil)https://github.com/frodegil
Boris Letocha (@Bobris)https://github.com/Bobris
https://github.com/frodegil
Frode Gilberg (frodegil)https://github.com/frodegil
on Aug 19, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-132538943
Bryan Rayner (@bryanerayner)https://github.com/bryanerayner
https://github.com/alan-compeat
alan-compeathttps://github.com/alan-compeat
on Aug 25, 2015https://github.com/microsoft/TypeScript/issues/1579#issuecomment-134746601
https://github.com/goodmind
andretshurotshka (goodmind)https://github.com/goodmind
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481083341
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481317167
https://github.com/dragomirtitian
Titian Cernicova-Dragomir (dragomirtitian)https://github.com/dragomirtitian
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481331321
https://github.com/fredgalvao
Frederico Galvão (fredgalvao)https://github.com/fredgalvao
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481360850
Titian Cernicova-Dragomir (@dragomirtitian)https://github.com/dragomirtitian
https://github.com/markusmauch
Markus Mauch (markusmauch)https://github.com/markusmauch
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481362090
andretshurotshka (@goodmind)https://github.com/goodmind
https://github.com/dsherret
David Sherret (dsherret)https://github.com/dsherret
on Apr 9, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-481364504
Titian Cernicova-Dragomir (@dragomirtitian)https://github.com/dragomirtitian
guidelinehttps://github.com/Microsoft/TypeScript/blob/972a149d4aa9ac1a6884efed4597e763716bc580/.github/ISSUE_TEMPLATE/Feature_request.md
non-goalhttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
compiler pluginhttps://github.com/dsherret/ts-nameof
https://github.com/jpierson
Jeff (jpierson)https://github.com/jpierson
on Apr 14, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-482915289
David Sherret (@dsherret)https://github.com/dsherret
one level deep propertieshttps://stackblitz.com/edit/typescript-zpqtxw
https://github.com/JLWalsh
James L. Walsh (JLWalsh)https://github.com/JLWalsh
on Apr 18, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-484315967
guidelinehttps://github.com/Microsoft/TypeScript/blob/972a149d4aa9ac1a6884efed4597e763716bc580/.github/ISSUE_TEMPLATE/Feature_request.md
https://github.com/dsherret
David Sherret (dsherret)https://github.com/dsherret
on Apr 18, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-484323477
James L. Walsh (@JLWalsh)https://github.com/JLWalsh
non-goalhttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
https://github.com/JoshZA
Josh (JoshZA)https://github.com/JoshZA
on May 22, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-494855334
https://github.com/snys98
Lulus Young (snys98)https://github.com/snys98
on Jun 24, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-505172164
James (@rjamesnw)https://github.com/rjamesnw
microsofthttps://github.com/microsoft
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/1579#event-2436120589
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/1579#issuecomment-505262490
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jan 25, 2024https://github.com/microsoft/TypeScript/issues/1579#issuecomment-1910910121
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 25, 2024https://github.com/microsoft/TypeScript/issues/1579#event-11601854471
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/1579
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/1579
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Waiting for TC39Unactionable until TC39 reaches some conclusionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%20TC39%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.