-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Given a path, parent currently gathers directory components starting from the bottom. From the docs: 'foo' eq path("foo/bar/baz")->parent(2);.
But if you want to get the top-most directory, you have to parse the directory yourself: '/a' eq path('/a/b/c/d/e/f/g/h/i/j')->parent(9). and you have to already know there are 9 directory components.
I propose allowing a negative index to indicate that parent should count from the top instead of the bottom: '/a' eq path('/a/b/c/d/e/f/g/h/i/j')->parent(-1).
Metadata
Metadata
Assignees
Labels
No labels