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'.
Pull request #92 addresses this issue.
Hey, sorry for the delayed response on this. The change looks good. I'll merge it and add unit tests for it. Thanks for contributing!
Closing as completed with the changes merged by the linked pull request.
This change has been published in [email protected].