-
Notifications
You must be signed in to change notification settings - Fork 36
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
Branches Does not preserve order #215
Comments
Thanks! Just to recap, the current documentation says that
which means that the keys are examined in object key order. The proposal is to change the order to match the order of the arguments instead. 🤔 Yeah, I think that change makes sense. It does likely require a bit more code to build the map and it is technically a breaking change, but unlikely to affect most users. Did you run into a problem due to this? I could imagine e.g. one using |
@polytypic - I was using branches along with a disperse, I had a collection of ids to update.
Then I would use Another option may be to create another Thanks for the quick response by the way! |
First off, I would like to say great work on this library, the documentation is fantastic and it makes dealing with complex objects easy.
My issue resolves around the order in which the branches are visited.
for example:
L.branches(1,2,3)
produces an object with the following keys. [1,2,3].L.branches(3,2,1)
produces an object with the following keys. [1,2,3]I would expect
L.branches(3,2,1)
to visit the keys in the order in which they were provided as arguments, as opposed to the object key order.I would propose using a
Map
to preserve the order of the arguments.The text was updated successfully, but these errors were encountered: