Interface support
See original GitHub issueIt would be good to support interfaces. This would mean that the person would have to use this library on the typescript before compiling (shouldn’t be done on the original source files obviously).
So maybe this:
interface MyInterface {
prop: string;
}
nameof<MyInterface>();
Compiles to:
"MyInterface";
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Contact Interface – We're Here to Help!
Contact Interface – We're Here to Help! · 1-800-727-1668 · 800-279-9090 · 866-593-3485 · Pay bills online · 888-947-8110.
Read more >Support Interface - an overview | ScienceDirect Topics
Support Interface. The SWu interface supports procedures for establishment or disconnection of an end-to-end tunnel between the UE and the ePDG.
Read more >What Support for an Interface Means - Win32 apps
To that end, the following table lists the interfaces that an ActiveX Control might support, and what it means to support that interface....
Read more >Contact Us | Commercial Carpet Tile & Resilient Flooring
US Headquarters. Interface 1280 West Peachtree St NW Atlanta, GA 30309. United States ; General Inquiries. 800-336-0225 ; Customer Service. 800-634-6032 ...
Read more >Cura Support Interface : r/3Dprinting - Reddit
There's a specific setting called "Enable Support Interface." It builds a flat roof (and/or floor) on support structures that better conforms to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@styfle that’s a very good point. I’ve thought about it a lot the past few days. Previously I was using the ts compiler so I could figure that out if the user were to pass in their compiler options to this library as well; however, I decided to drop using the ts compiler for performance reasons and to better support streams (coming this weekend probably).
So yes, you’re right that there won’t be a safety check when running this on typescript code; however, I would think that the vast majority of people will be using IDEs and the IDE will show them the compiler error when they do
nameof(undefinedvariablename)
. It’s not perfect, but they will get the error from their IDE. It’s still a lot better than just using strings.@Brandejs try using the new webpack instructions and don’t use tsnameof-loader: https://github.com/dsherret/ts-nameof/blob/master/setup/webpack.md
Also, highly recommend opening new issues in the issue tracker for new problems. It’s very easy for comments on resolved issues to get lost.