class-transformer icon indicating copy to clipboard operation
class-transformer copied to clipboard

Underscores on Javascript classes

Open FredOleary opened this issue 8 years ago • 4 comments

Hi, Im evaluating class-transformer and it looks great. However our project uses plain JS files, not typescript. So variables declared in the class constructor get prefixed with '_'. Eg 'this.name' creates '_name' The result of this is classToPlain creates {name:xxx } rather than {name:xxx } Is there anyway to remove these '' ? (Because its not typescript the @Expose annotation won't work) Thanks

FredOleary avatar Jun 15 '18 19:06 FredOleary

(Because its not typescript the @expose annotation won't work)

@FredOleary why? Could you explain your problem one more time with better explanation?

cojack avatar Oct 21 '18 19:10 cojack

Hi @FredOleary, to make it work, you will need to add support for decorators via the Babel decorator plugin.

NoNameProvided avatar Oct 24 '18 11:10 NoNameProvided

I will go ahead and close this question, but feel free to continute the conversation if you have any more question.

NoNameProvided avatar Oct 24 '18 11:10 NoNameProvided

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Aug 01 '20 00:08 github-actions[bot]