You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constjp=require('jsonpath')leto={a:1}console.log(jp.parent(o,'$.a'))// { a: 1 }jp.parent(o,'$.DOESNOTEXIST')// Uncaught TypeError: Cannot read properties of undefined (reading 'path')// at JSONPath.parent (./node_modules/jsonpath/lib/index.js:26:18)
I expected this to work, since the parent does exist. (I expected the parser of the expression to drop the final term and resolve the path, instead of resolving the path and then backing up one.)
If I did jp.parent({}, '$.foo.bar.jim.jam') I would expect it to return null, or an empty array, not to error out on some internal code.
Activity