Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Conversation

@bigomega
Copy link

Fixes #22

  • Sending array or object based on number of refs given. Making sure it's backward compatible.
  • Add tests for the new code
  • Update README

We could extend this to other functions as well, but I didn't find the need to do it (yet).

if(refs.length == 1)
return findWithRefForOne(root, refs[0]);

return refs.map(ref => findWithRefForOne(root, ref));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could optimize this by changing the findAll function to take in multiple options so that it does the tree traversal only once. But if we need this just for findWithRef those changes would seem unnecessary

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant