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

Support literal union types #28

Merged
merged 1 commit into from
Apr 24, 2020
Merged

Support literal union types #28

merged 1 commit into from
Apr 24, 2020

Conversation

claabs
Copy link
Contributor

@claabs claabs commented Apr 24, 2020

Adds support for unioned literals.

 color: 'red' | 'blue' | 'yellow';

Will output one of the possible values randomly. In fixed mode, it will choose the first literal.

This is written to only support union types that are exclusively literals. Mixed types are not supported:

// Will NOT work
color: 'red' | 'yellow' | string;

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@claabs
Copy link
Contributor Author

claabs commented Apr 24, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@ryanmcdermott
Copy link
Member

This looks great, thank you so much!

@ryanmcdermott ryanmcdermott merged commit 6d72f68 into google:master Apr 24, 2020
@ryanmcdermott
Copy link
Member

Because of COVID-19, I'm not able to upload new releases to NPM because I'm not in the office. I'll do this as soon as I'm back there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants