The JSON path parsing code assumes that string keys within square brackets in JSON paths will be valid, parseable JSON.
However, the ajv library on which this project depends emits string keys in single quotes.
For example, ajv can emit .foo['bar'], which will ultimately end up with a call to JSON.parse("'bar'"). This causes the "Unexpected token ' in JSON at position 0" error thrown from JSON.parse.
Since ajv shouldn't need to change and since this utility is gone in the next branch, this fix checks for ajv-formatted string keys and patches them to double-quoted strings before calling JSON.parse. This is the narrowest fix for the problem.