Closed sindresorhus closed 10 years ago
It's certainly debatable, but for the purposes of this module, a path is inside itself.
I'd accept a PR for a pathIsInside.exclusive
that returns false in that case.
Sidenote: you should path.resolve(thePath) so I the consumer doesn't have to do it when passing relative paths.
No; this is the user's responsibility.
It's certainly debatable, but for the purposes of this module, a path is inside itself.
At least point out the behaviour in the usage example. It was a surprise to me.
No; this is the user's responsibility.
That's inconsistent with any Node core method which which accepts a path, which can be relative.
At least point out the behaviour in the usage example. It was a surprise to me.
Done.
That's inconsistent with any Node core method which which accepts a path, which can be relative.
It's consistent with all methods in path
except for path.relative
.
When both paths are identical it returns true, but that is kinda misleading as it's supposed to tell whether the path is inside another one.
Testcase:
Should return false.
Sidenote: you should
path.resolve(thePath)
so I the consumer doesn't have to do it when passing relative paths.