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

get to stop supporting array paths #272

Open
richytong opened this issue Feb 14, 2024 · 1 comment
Open

get to stop supporting array paths #272

richytong opened this issue Feb 14, 2024 · 1 comment
Labels
breaking needs to be released in a major enhancement New feature or request

Comments

@richytong
Copy link
Collaborator

Currently get is able to support array paths to access properties on an object

get({ a: { b: { c: 1 } } }, ['a', 'b', 'c']) // 1

However this blocks the eager API when trying to access indexed values on an array. It returns a function instead for the lazy API.

get([1, 2, 3], 0) // [Function: arg0Resolver]

We should amend the API to stop supporting array paths so we can eagerly access arrays.

@richytong richytong added enhancement New feature or request breaking needs to be released in a major labels Feb 14, 2024
@richytong
Copy link
Collaborator Author

An alternative to array paths is string paths

get({ a: { b: { c: 1 } } }, ['a', 'b', 'c']) // 1

get({ a: { b: { c: 1 } } }, 'a.b.c') // 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking needs to be released in a major enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant