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 incorrect behavior for keys ending with a dot #21

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Fix incorrect behavior for keys ending with a dot #21

merged 1 commit into from
Apr 1, 2020

Conversation

GlennKintscher
Copy link
Contributor

If the key ends with a dot, then the last element in the "keys" array is an empty string - this causes the condition of the while-loop to evaluate to false. Due to this, a second (empty) element is pushed to "res" array. Comparing the next value of the "keys" array with null/undefined fixes this.

Fixes doowb/group-array#11

@doowb
Copy link
Collaborator

doowb commented Apr 1, 2020

@GlennKintscher thanks for the PR! I'll try to get this published soon.

@doowb doowb merged commit 236f797 into jonschlinkert:master Apr 1, 2020
doowb added a commit that referenced this pull request Apr 1, 2020
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.

Odd behavior on values ending in .
2 participants