dfilatov / jspath

DSL that enables you to navigate and find data within your JSON documents
MIT License
553 stars 40 forks source link

String "ends with" comparison issue: left operand being 1 character less than right operand #61

Closed mateuadsuara closed 7 years ago

mateuadsuara commented 7 years ago

On v3.10.3, a predicate containing an "ends with" operator ($= or $==) will return true when the left operand is one character less than the right operand, even if they don't match.

For example:

var doc = {
  "books" : [
    {
      "title" : "Javascrip"
    }
  ]
}

var wat = JSPath.apply('.books{.title $== "Javascript"}', doc)

expect(wat).toEqual([])
dfilatov commented 7 years ago

@mateuadsuara JSPath doesn't have v3.10.3, current version is 0.3.4 and this bug was fixed in it.

mateuadsuara commented 7 years ago

Sorry, I was using 0.3.3 (I confused how to get the version number). Great! thanks for the quick response :)