-
Notifications
You must be signed in to change notification settings - Fork 8
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
Trips up on sub JSON with query key #11
Comments
Thanks kmpatel for trying this lib and providing feedback! Did you call "jsonRemoveWhiteSpace()" first? json = jsonRemoveWhiteSpace(json); |
Oh. No, I did not use jsonRemoveWhiteSpace. But is 'jsonRemoveWhiteSpace' a solution to subJSON with duplicate keys, or the beautified JSON? |
If I recall, will return first match for dups. |
I don't think you are paying attention to the example. The example is a perfectly valid JSON with no actually duplicates; I should have written "apparent duplicate". In the example, the call is to find the value of "child". Instead, the fn returns the value of "parent.child", which is the wrong member. It is a only a duplicate by appearance, when in fact it is valid member of sub-json "parent" that happens to appear before the target member "child". |
Yes, I beleive you have identified a bug in the code. The string searches are very rudimentary. I'll look to see if there is an easy way to fix this, but you may want to swich to a more robust libary. |
e.g.
The text was updated successfully, but these errors were encountered: