Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken code gen in strict mode with functions on object attributes #182

Open
kwojcik opened this issue Aug 19, 2022 · 2 comments
Open

Broken code gen in strict mode with functions on object attributes #182

kwojcik opened this issue Aug 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@kwojcik
Copy link

kwojcik commented Aug 19, 2022

Forgive my poor issue title because I don't know the exact issue, but I've got a perfect minimal repro for you https://github.com/kwojcik/ts-migrate-bug.

The generated code has extra })'s and breaks.

@kwojcik
Copy link
Author

kwojcik commented Aug 19, 2022

diff --git a/src/Property.js b/src/Property.js
index 7aba662..12cf253 100644
--- a/src/Property.js
+++ b/src/Property.js
@@ -7,8 +7,9 @@ export default class Property {
   overview() {
     return flatten(this.foos.map(foo =>
       Object.entries(groupBy(foo.foo, 'bar')).map(() => {
+        const { fooType } = foo;
         return {
-          name: `${foo.fooType}`,
+          name: `${fooType}`,
         };
       })
     ));

this change to the src fixes it

@Rudeg Rudeg added the bug Something isn't working label Sep 2, 2022
@oltodo
Copy link

oltodo commented Nov 17, 2022

I met the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants