-
Notifications
You must be signed in to change notification settings - Fork 19
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: use Map size to calculate the number of children #73
Conversation
This ensures that child nodes are counted correctly. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size
Thanks for the PR! Is there a chance you can add a fixture to the tests that were previously failing? 🙏🏼 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #73 +/- ##
=======================================
Coverage 95.63% 95.63%
=======================================
Files 4 4
Lines 435 435
Branches 83 84 +1
=======================================
Hits 416 416
Misses 19 19 ☔ View full report in Codecov by Sentry. |
Thanks for taking a look @pi0. I've written a test to cover this. Changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💯
@AndrewWalsh Since main branch is already prepared for 2.x release, this patch will be included in 2.x once released but please let me know if it is something blocking for you i can make a hotfix branch to cherry-pick it. |
All good, I don't need the fix from my end, thanks for the consideration. |
fix: use Map
size
property to calculate the number of children. The current approach does not count them correctlyhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size
🔗 Linked issue
❓ Type of change
📚 Description
remove
will remove nodes that have no data, but do have childrensize
property to count children correctly and align with the original intended behaviour📝 Checklist