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

Values of number zero are always filtered if filter is set #406

Closed
jreichenberg opened this issue Mar 23, 2020 · 3 comments · Fixed by #423
Closed

Values of number zero are always filtered if filter is set #406

jreichenberg opened this issue Mar 23, 2020 · 3 comments · Fixed by #423

Comments

@jreichenberg
Copy link
Contributor

Hi,

For a token defined with value zero, for example opacity: {value: 0}, and any filter function set in config it appears that token is always filtered out.

I believe the cause is https://github.com/amzn/style-dictionary/blob/master/lib/filterProperties.js#L37, which perhaps should be } else if (typeof value.value !== 'undefined') {

This line only kicks in if a filter is set in config, as the entire filtering check is bypassed with no filter config.

Thoughts?

@dbanksdesign
Copy link
Member

Good catch! You are right, we had an issue with that outside of the filters because of a conditional like that.

@arielwb
Copy link

arielwb commented Jul 6, 2020

Hi @dbanksdesign!
Any chance we get a release (or an alpha) containing this fix?

@dbanksdesign
Copy link
Member

Sorry about that @arielwb! It should be published now in v2.10.1!

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 a pull request may close this issue.

3 participants