Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

feature request: Path.toParent() #97

Open
capaj opened this issue Jun 24, 2015 · 0 comments
Open

feature request: Path.toParent() #97

capaj opened this issue Jun 24, 2015 · 0 comments

Comments

@capaj
Copy link
Contributor

capaj commented Jun 24, 2015

I have a path like this for example:

'foo.arr[map]'
or
'foo.arr.map'

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');
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant