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

Implement skips for stringify array format comma #304

Conversation

decimoseptimo
Copy link
Contributor

@decimoseptimo decimoseptimo commented Jan 10, 2021

Fixes #302

@sindresorhus sindresorhus mentioned this pull request Jan 12, 2021
test/stringify.js Outdated Show resolved Hide resolved
Base automatically changed from master to main January 24, 2021 06:08
test/parse.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Is this PR done and ready to be re-reviewed?

@decimoseptimo
Copy link
Contributor Author

Yes it is.

readme.md Show resolved Hide resolved
@decimoseptimo decimoseptimo force-pushed the implement-skips-for-stringify-arrayFormat-comma branch 2 times, most recently from da64fb0 to 4c29858 Compare March 11, 2021 04:03
@sindresorhus sindresorhus merged commit 828f032 into sindresorhus:main Mar 17, 2021
@DV8FromTheWorld
Copy link
Contributor

DV8FromTheWorld commented Mar 17, 2021

This is a breaking change to the default functionality of stringify for comma and separator array modes given that skipNull and skipEmptyString are default false but the original functionality of stringify for these 2 modes behaved as though skipNull and skipEmptyString were true.

Anyone relying on the original behavior will now have different results after this change.

Doesn't this require a major version revision?

@decimoseptimo
Copy link
Contributor Author

The documented default behaviour for skipNull and skipEmptyString is and had been false. Because stringify was broken, it wasn't checking for those, and it would resemble to true.
It should at least added to the release notes that it would unbreak things, it's up to the owner about the version bump.

@DV8FromTheWorld
Copy link
Contributor

DV8FromTheWorld commented Mar 17, 2021

The documented default behavior of skipNull and skipEmptyString has always been false, yes. But you've modified the default behavior of the comma and separator methods which weren't following those options before. It wasn't "broken" per-se, it was just not respecting the options. The functionality of comma has existed for 2 years and predates both of these options, so it isn't really correct to say it was broken.

The point I'm making is that this change breaks assumptions that already exist in the library that the comma and separator options always stringify by dropping any falsy values. Any software that consumes this library and that is built on that assumption is going to encounter problems if this change is released under a non-major-version change considering that most library inclusion into projects uses fuzzy matching based on minor+revision.

I'd suggest releasing this change as a major revision to 7.x given the breaking nature of it.

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.

Stringify isn't respecting skipNull nor skipEmptyString when arrayFormat: "comma"
3 participants