Wanted real path with dot-notation in JSONSelect.forEach callback
Hello there! First of all, your project is awesome!
It would be great if you could add the real-path with dot-notation of matched values in place of second argument of callback in forEach-method.
For example, we have a JSON:
var data = { a: {x: 1, y: 2}, b: ["one", "two"] };
JSONSelect.forEach('.a > number, .b :nth-child(1n)', data, function( value, path ){ // Here I would love to see: // value - 1, path - "a.x" // value - 2, path - "a.y" // value - "one", path - "b.0" // value - "two", path - "b.1" });
Is it possible? Thank you in advance.
I would like to see something similar in expr. So you could do something like ".a:expr(x.y = 2)" (note that x in this case is actually the variable for expr which will actually be a :).