R.sort doesn't work with HTMLCollection
selfrefactor opened this issue · 4 comments
Issue created from this comment - #459 (comment)
Hey @coreagile
I thought about the issue and one problem I have is that it will be hard to test for it as Rambda has node
as Jest testEnvironment
. From my experience with HTMLCollections is that they need Array.from
wrapper to have proper list methods.
const list = Array.from(document.forms)
list.sort // => function
The issue is that Rambda.sort doesn't have a fallback in case the list argument doesn't have sort
property. I can easily fix it with adding this fallback, but my issue is that if I do, then there are plenty more places where I should do that.
I am currently in a sick leave, but afterwards I will look into the issue.
A fix will be applied with the new version. I will keep the issue open until the release is made.
I am closing the issue as the fix is released with version 7.0.0
.