and I would really appreciate it, if I could easily get a new path which would lose the last property accessor.
I could parse the strings, but it seems to me this would be useful feature for other people using Path objects.
so ideally:
var pathObj = Path.get('foo.arr[map]');
var parentPathObj = pathObj.toParent();
parentPathObj //should be equivalent to Path.get('foo.arr');
I have a path like this for example:
and I would really appreciate it, if I could easily get a new path which would lose the last property accessor. I could parse the strings, but it seems to me this would be useful feature for other people using Path objects.
so ideally: