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

Fix parsing of array paths for non standard separators #58

Merged
merged 1 commit into from
Sep 10, 2020
Merged

Fix parsing of array paths for non standard separators #58

merged 1 commit into from
Sep 10, 2020

Conversation

boidolr
Copy link
Contributor

@boidolr boidolr commented Aug 1, 2020

Prior to the change arrays only worked with the default separator of ..
So the following currently has different results, even though one would expect them to behave the same:

var Dot = require("dot-object");

// default separator, works as expected:
console.log(Dot.object({'first.name[0]': 'first'}));
// outputs: {first: {name: ["first"]}}

// non standard separator, does not return array:
console.log(new Dot('_').object({'first_name[0]': 'first'}));
// outputs: {first: {name.0: "first"}}

With this fix, the second version gives the same result as the first one.

@boidolr
Copy link
Contributor Author

boidolr commented Sep 5, 2020

@rhalff would it be possible to get this fix included?

@rhalff rhalff merged commit 2f78b82 into rhalff:master Sep 10, 2020
@rhalff
Copy link
Owner

rhalff commented Sep 10, 2020

@boidolr Thanks for the PR. This was released as version 2.1.4

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

Successfully merging this pull request may close these issues.

2 participants