You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the class/function names of a generated API and ts-nameof looks like a great way to make this more compile safe.
My API is a class, for example UserApi so has to be initialised with new. Used like new UserApi().getUser(). I want something like "UserApi.getUser". Because it's a class, I can't use nameof like: UserApi.getUser, I have to do UserApi.prototype.getUser. This however gives "UserApi.prototype.getUser".
Is there any way to get just "UserApi.getUser", without the "prototype"?
The text was updated successfully, but these errors were encountered:
hanvyj
changed the title
Names on prototypes
Accessing the full name of properties on class (without a '.prototype')
Jun 18, 2020
I'm using the class/function names of a generated API and
ts-nameof
looks like a great way to make this more compile safe.My API is a class, for example
UserApi
so has to be initialised with new. Used likenew UserApi().getUser()
. I want something like "UserApi.getUser". Because it's a class, I can't usenameof
like:UserApi.getUser
, I have to doUserApi.prototype.getUser
. This however gives "UserApi.prototype.getUser".Is there any way to get just "UserApi.getUser", without the "prototype"?
The text was updated successfully, but these errors were encountered: