Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

handle Literal types as ObjectPattern keys#27

Merged
guybedford merged 3 commits intorollup:masterfrom
edoardocavazza:issues/25
May 6, 2018
Merged

handle Literal types as ObjectPattern keys#27
guybedford merged 3 commits intorollup:masterfrom
edoardocavazza:issues/25

Conversation

@edoardocavazza
Copy link
Copy Markdown
Contributor

fixes #25

added Literal to extractors

@guybedford
Copy link
Copy Markdown
Contributor

Thanks for the PR here. Could you please add a test for the ObjectPattern case here?

@edoardocavazza
Copy link
Copy Markdown
Contributor Author

Sure!

@guybedford
Copy link
Copy Markdown
Contributor

Thanks for the quick fix Do you think we could include a nested case like:

({ a: { b: c } } = { a: { b: 'b' } });

just to be sure the destructuring plays out right?

@edoardocavazza
Copy link
Copy Markdown
Contributor Author

Hi @guybedford, I am sorry for the delay. I added the case let { a: { b: c } } = { a: { b: 'b' } }; and it seems to work, but I found out that the library does not handle ExpressionStatements like you suggested. If you agree, I can open an issue for that.

@guybedford
Copy link
Copy Markdown
Contributor

@edoardocavazza sure it would be great to create an issue for that.

This looks great to me, thanks again for the PR.

@guybedford guybedford merged commit 7f4d328 into rollup:master May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extractNames does not work with ObjectPattern with literal keys

2 participants