Skip to content
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

Feature suggestion, upstream path #7

Open
chrisjameslennon opened this issue Apr 8, 2024 · 4 comments
Open

Feature suggestion, upstream path #7

chrisjameslennon opened this issue Apr 8, 2024 · 4 comments

Comments

@chrisjameslennon
Copy link

Sometimes it is helpful to go up the tree as well as down it. Would you consider a method like .upstreamPath() that returns the path, upwards until the root node

To be honest I am not sure it is as simple as that :-) But this feature would be useful I think

@chrisjameslennon chrisjameslennon changed the title Feature suggestions, upstream path Feature suggestion, upstream path Apr 8, 2024
@ljharb
Copy link
Owner

ljharb commented Apr 8, 2024

Separate from the technical implementation - which i suspect would be tricky - what's the use case?

@chrisjameslennon
Copy link
Author

I am writing a json model generation (with schema validation) library

@ljharb
Copy link
Owner

ljharb commented Apr 10, 2024

can you elaborate? when you're traversing down, you can easily keep references to the parents; when is it necessary to not do that such that you'd need the path?

@chrisjameslennon
Copy link
Author

I thought you might ask me that :-) I make several traversals, and gather data on the object. However keeping references to parents may be sufficient. I'll pursue that approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants