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

Stringify: allow empty string for indent option #151

Merged
merged 2 commits into from
May 25, 2021

Conversation

fritz-c
Copy link
Contributor

@fritz-c fritz-c commented Feb 24, 2021

In the existing implementation, empty strings used in the indent option are treated as falsy and therefore ignored in the following fallback:

return Array(this.level).join(this.indentation || ' ');

This PR resolves that issue, and adds tests for behavior surrounding the indent option.

@fritz-c
Copy link
Contributor Author

fritz-c commented Mar 5, 2021

@SlexAxton Apologies for the ping, but I think you will find this bugfix PR limited in scope, with non-breaking changes and newly added tests to confirm the proper behavior. I would appreciate it if you could review it.

@fritz-c
Copy link
Contributor Author

fritz-c commented Mar 25, 2021

@tj Apologies for the ping, but I think you will find this bugfix PR limited in scope, with non-breaking changes and newly added tests to confirm the proper behavior. I would appreciate it if you could review it.

@solugebefola
Copy link

Has anyone taken a look at this PR? I got here from the issue in jest-styled-components @dineshks1 ?

@SlexAxton SlexAxton merged commit 434aa17 into reworkcss:master May 25, 2021
@fritz-c fritz-c deleted the stringify-allow-empty-indent branch May 25, 2021 20:31
@fritz-c
Copy link
Contributor Author

fritz-c commented May 31, 2021

@SlexAxton Thank you for merging the PR. Could you make an npm release including the fix so I can complete the PR that depends on this in jest-styled-components?

@cincodenada
Copy link

cincodenada commented Jul 26, 2022

Ha, well well...I came here after taking the same journey as @fritz-c tracking down why my diffs in jest-styled-components were broken, and got as far as re-finding the bug, mostly fixing it, running into this same issue, guessing it was an empty string bug, and coming here to confirm.

Which is to say: seconded, is it possible to get a 3.0.1 release with just this change? jest-styled-components is a widely-used library that is much noisier than necessary due to this bug.

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.

4 participants