Skip to content

fix: respect {} in safe typestring splitting #46

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

Merged
merged 3 commits into from
Oct 26, 2020

Conversation

nornagon
Copy link
Contributor

This allows constructions such as:

### `foo(bar)`

* `bar` Function<{type: 'a'} | { type: 'b', extraThing? 'c' }>

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for what this is supposed to support, I'm not sure how this achieves what you put in the PR body

@nornagon
Copy link
Contributor Author

@MarshallOfSound test added. This PR makes commas inside of a {} pair part of the type itself, instead of splitting when it encounters a , inside {}.

Before, Function<{foo: A, bar: B}> would parse as a function type with two arguments, of type {foo: A and bar: B}. Now, it parses as a function type with one argument, of type {foo: A, bar: B}.

@MarshallOfSound MarshallOfSound merged commit cc7e890 into electron:master Oct 26, 2020
@electron-bot
Copy link

🎉 This PR is included in version 0.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nornagon nornagon deleted the patch-1 branch October 26, 2020 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants