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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform boolean attribute values to preserve reasonable values. #93

Closed
wants to merge 2 commits into from

Conversation

au-z
Copy link
Contributor

@au-z au-z commented Jan 29, 2020

In the case of a Hybrids element property with a default value of 'true', any attempt to make the property false by passing an attribute value of 'false' failed.

Instead of passing boolean attribute values through the Boolean constructor, this change passes 'true' and 'false' values through JSON.parse() to avoid confusing during attribute assignment to properties.

If you'd prefer a different approach than the one described in this PR or have some workaround in mind, by all means, feel free to reject it. 馃槃

You should know that I had some trouble getting the tests to run on my machine and so I've made the modifications to the spec file blindly. If all looks good, you should at least pull the branch down and run the test in case I've fat-fingered something there.


Related Issue: #92

In the case of a Hybrids element property with a default value of 'true', any attempt to make the property false by passing an attribute value of 'false' failed.
Instead of passing boolean attribute values through the Boolean constructor, this change passes 'true' and 'false' values through JSON.parse() to avoid confusing during attribute assignment to properties.

---

Related Issue: hybridsjs#92
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 29, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cbad40c:

Sandbox Source
Hybrids: Simple Counter Configuration

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling cbad40c on auzmartist:transform-boolean-properties into 648875a on hybridsjs:master.

@smalluban
Copy link
Contributor

Closing, as I explained in #92.

@smalluban smalluban closed this Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants