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

Unify Get and Paths / PickDeep etc #863

Open
voxpelli opened this issue Apr 12, 2024 · 1 comment
Open

Unify Get and Paths / PickDeep etc #863

voxpelli opened this issue Apr 12, 2024 · 1 comment

Comments

@voxpelli
Copy link
Collaborator

voxpelli commented Apr 12, 2024

Its a bit odd that we have Get which accepts three styles of specifying paths, but doesn't use Paths, and also have PickDeep etc which use Paths and only accepts a single style of specifying paths.

  • Paths is used to validate that the specified paths are valid options + used to give intellisense, both which are handy.
  • Paths only supports the foo.0.bar style of paths whereas Get also supports foo[0].bar and ['foo', '0', 'bar'], is that maybe overkill for Get? Or, if useful, should Paths etc be extended with the same functionality?

Desired outcome:

Ideally Get and Paths / PickDeep etc should behave the same when it comes to paths and use the same fundamentals.

Random notes

PickDeep and Get feels fairly similar in other ways as well – maybe one could adapt the internals of PickDeep to also serve Get?

I gave it a look and a try but got a headache and needs to bang my head against something right now.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@voxpelli
Copy link
Collaborator Author

Something to keep in mind if one unifies is that ., [, ] are all valid property names of an object, which breaks the text based paths: #864

(Also: Symbols are valid properties as well but can't be expressed in any of the two current paths implementations)

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

No branches or pull requests

1 participant