Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Modify isSubpath logic
Browse files Browse the repository at this point in the history
  • Loading branch information
janicklas-ralph committed Feb 23, 2024
1 parent 6b2e130 commit aedd05c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/critters/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ export function createLogger(logLevel) {
}

export function isSubpath(basePath, currentPath) {
const relative = path.relative(basePath, currentPath);
return relative && !relative.startsWith('..') && !path.isAbsolute(relative);
return !path.relative(basePath, currentPath).startsWith('..');
}

0 comments on commit aedd05c

Please sign in to comment.