Skip to content

(MODULES-9049) Add type alias for 'yes' and 'no'. #1017

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 1 commit into from
Aug 27, 2019

Conversation

ghoneycutt
Copy link
Contributor

No description provided.

@ghoneycutt
Copy link
Contributor Author

@ghoneycutt
Copy link
Contributor Author

Could someone please take a look, thank you!

@hlindberg
Copy link
Contributor

I think this is fine - it would be nice to make them case independent which could be done by using a Pattern data type with a regexp where the case independent flag is turned on.
For example:

type YesNo = Pattern[/\A(?i:(yes|no))\z/]

This works hand in hand with Boolean($val) since it turns a yes/no into boolean in the same case independent way.

@ghoneycutt
Copy link
Contributor Author

Good idea Henrik. I'll get the PR amended.

@ghoneycutt
Copy link
Contributor Author

@hlindberg look good?

@tphoney
Copy link
Contributor

tphoney commented Aug 27, 2019

Looks good to me, Merging.

Thanks for the PR @ghoneycutt

@tphoney tphoney merged commit f34f284 into puppetlabs:master Aug 27, 2019
@ghoneycutt ghoneycutt deleted the 9049_yes_no branch January 25, 2021 19:12
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.

3 participants