Skip to content

Commit

Permalink
optimize root path checks for CWD scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
nimesh0505 committed Sep 4, 2024
1 parent 64bc7f8 commit 513b8c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ function checkRootPathForErrors (fastify, rootPath, skipExistenceCheck) {
}

function checkPath (fastify, rootPath, skipExistenceCheck) {
// skip all checks if rootPath is the CWD
if (rootPath === process.cwd()) {
return
}
if (typeof rootPath !== 'string') {
throw new Error('"root" option must be a string')
}
Expand Down

0 comments on commit 513b8c4

Please sign in to comment.