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

fix(toggle): handle falsy input as expected #82

Merged
merged 6 commits into from
Jul 9, 2024

Conversation

Minhir
Copy link
Member

@Minhir Minhir commented Jul 4, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Previously, toggle didn't work with falsy values in array toggle([1, 2], 0).

Related issue, if any:

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

It could be a breaking change (even if it's clearly bug). I think it should be released together with #70.

@Minhir Minhir requested a review from aleclarson as a code owner July 4, 2024 20:58
@aleclarson
Copy link
Member

I'm not huge on catering to anyone relying on undocumented behavior. For however many do, there's a hypothetical equal number of users whose code is unknowingly broken without this patch. That means I'd be fine with treating this as a non-breaking change.

@aleclarson aleclarson changed the title fix: work with falsy values in toggle fix(toggle): handle falsy input as expected Jul 8, 2024
@aleclarson aleclarson merged commit 547c6f3 into radashi-org:main Jul 9, 2024
4 checks passed
@aleclarson
Copy link
Member

Thanks @Minhir!

@aleclarson aleclarson added the upstream fix Fixes a bug that existed in Radash label Jul 9, 2024
Copy link

A new beta version 12.2.0-beta.0dc9c8a has been published to NPM. 🚀

To install:

The radashi@beta tag also includes this PR.

See the changes

@Minhir Minhir deleted the fix/toggle branch July 10, 2024 09:03
@aleclarson
Copy link
Member

Resolves sodiray/radash#417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream fix Fixes a bug that existed in Radash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants