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

Accept numbers as path elements #12

Closed
Andarist opened this issue Sep 9, 2018 · 2 comments
Closed

Accept numbers as path elements #12

Andarist opened this issue Sep 9, 2018 · 2 comments

Comments

@Andarist
Copy link

Andarist commented Sep 9, 2018

This seems like a reasonable input for me. Both ramda & lodash accept it.

var obj = {}
dset(obj, ['foo', 10, 'baz'], 'bar')

Mentioned libraries also handle this by creating an object instead of array (like in my previously reported issue):

var obj = {}
dset(obj, ['foo', 10.2, 'baz'], 'bar')
@lukeed
Copy link
Owner

lukeed commented Sep 9, 2018

So, basically nothing else treats numbers as indices for array creation?

@Andarist
Copy link
Author

Andarist commented Sep 9, 2018 via email

lukeed added a commit that referenced this issue Jan 27, 2021
- ["foo", "10.0"] => object
- ["foo", 10.0] => array
^ matches lodash
- Closes #12
@lukeed lukeed mentioned this issue Jan 28, 2021
@lukeed lukeed closed this as completed in 5b09e52 Jan 28, 2021
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