Skip to content

Stringify: allow empty string for indent option - #151

Merged
SlexAxton merged 2 commits into
reworkcss:masterfrom
fritz-c:stringify-allow-empty-indent
May 25, 2021
Merged

SlexAxton merged 2 commits into
reworkcss:masterfrom
fritz-c:stringify-allow-empty-indent

Conversation

@fritz-c

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

Copy link
Copy Markdown
Contributor

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

fritz-c commented Mar 5, 2021

Copy link
Copy Markdown
Contributor Author

@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

fritz-c commented Mar 25, 2021

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown

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

fritz-c commented May 31, 2021

Copy link
Copy Markdown
Contributor Author

@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

cincodenada commented Jul 26, 2022 •

Copy link
Copy Markdown

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.

@MoOx

MoOx commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Is anyone still interested in a 3.0.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 this pull request may close these issues.

5 participants