ts-simple-nameof icon indicating copy to clipboard operation
ts-simple-nameof copied to clipboard

When a class extends another, an unexpected name is returned

Open JoeMeeks opened this issue 1 year ago • 1 comments

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'.

JoeMeeks avatar Nov 02 '24 00:11 JoeMeeks

Pull request #92 addresses this issue.

JoeMeeks avatar Nov 12 '24 16:11 JoeMeeks

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!

IRCraziestTaxi avatar Jul 26 '25 04:07 IRCraziestTaxi

Closing as completed with the changes merged by the linked pull request.

IRCraziestTaxi avatar Jul 26 '25 04:07 IRCraziestTaxi

This change has been published in [email protected].

IRCraziestTaxi avatar Jul 26 '25 05:07 IRCraziestTaxi