ts-simple-nameof
ts-simple-nameof copied to clipboard
When a class extends another, an unexpected name is returned
In this use case nameof(MediaPlayerComponent);
where MediaPlayerComponent
extends a class named ContentComponentBase
, the result is "MediaPlayerComponent extends shared__WEBPACK_IMPORTED_MODULE_2__.ContentComponentBase". My workaround is to omit any spaces and following characters like so nameof(MediaPlayerComponent).substring(0, nameof(MediaPlayerComponent).indexOf(' ')):
but it would be fantastic if this library did so automatically when the name includes a space or perhaps when the name includes ' extends'
.