Closed gorru closed 8 years ago
Can you send a sample json or setup a jsfiddle/codepen ?
Got the same issue. It might even be a bigger problem, not sure. So anytime you try to find something that has any function: value, sort, each, filter etc... inside your json, it will fail.
Maybe adding a _ before any of those function calls would solve the issue? Like: jsonq._value() this way it wouldn't be overwritten.
{properties: { choices: [ { label: 'Foo', value: 'Bar' }, { label: 'Foo2', value: 'Bar2' } ] }}
We fixed the issue by mapping the function with the same name, like so: jsonQ.prototype._value = jsonQ.fn.value
And then using _value instead of value.
But really this should be fixed in jsonQ code so that it supports any json object that is passed.
This seems to be a big issue, I will look into it for the possible fix.
Fixed on v1.1.0 . Let me know if you guys find any issue with new release.
Thanks for the quick turn around. Seemed to be working. 👍
Hi. In my json I have many nodes named value. When I check the output of the find function and try to call the value() function I noticed that the function is overridden by the a value property of type array. How can I fix this behaviour? Thanks in advance.