sodiray / radash

Functional utility library - modern, simple, typed, powerful
https://radash-docs.vercel.app
MIT License
4.1k stars 160 forks source link

[Array] toggle with falsy elements returns wrong result #417

Open karoyqiu opened 1 month ago

karoyqiu commented 1 month ago

Code: toggle([0, 1, 2, 3], 0)

Expected result: [1, 2, 3]

Actual result: [0, 1, 2, 3]

Radash version 12.1.0

aleclarson commented 1 month ago

Hello @karoyqiu, we've fixed this over at the Radashi fork. You can use it today by installing radashi@beta. An official release is pending until I get the docs running. You can check out the CHANGELOG.md to see everything we've added/fixed.