JSONPath-Plus / JSONPath

A fork of JSONPath from http://goessner.net/articles/JsonPath/
Other
975 stars 175 forks source link

Improve error message for missing `json` property in constructor #110

Closed rozele closed 4 years ago

rozele commented 4 years ago

Given the following:

new JSONPath({ path: "$" })

The error message is:

You must supply a "path" property when providing an object argument to JSONPath.evaluate().

It should probably be:

You must supply a "json" property when providing an object argument to JSONPath.evaluate().
brettz9 commented 4 years ago

Added in v2.0.0. Thanks for the report.

Note that if json is present but undefined, it will still not throw, as there is the potential one is trying to query undefined.