jmespath/jmespath.js

How to access where attribute begins with a number?

Opened this issue · 3 comments

consider this:

var x = {}
x.y = {}
x.y['3av'] = 'hello'

How can I access x.y.3av using jmespath? It returns an error no matter what I try.

please try 'x.y."3av"'

The implication of this is that if I'm dynamically constructing my search strings - which I usually am - then I need to quote every level.

Isn't this edge case is better suited to happening inside the library?

I think you can apply it only to cases where your literal starts from digit.