Skip to content

Commit

Permalink
refactor: remove unused bindings (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Oct 22, 2023
1 parent 16d3f27 commit 8f4e793
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function findIndexFile (pathname, root, indexFiles = ['index.html']) {
try {
const stats = statSync(p)
return !stats.isDirectory()
} catch (e) {
} catch {
return false
}
})
Expand Down Expand Up @@ -542,7 +542,7 @@ function getRedirectUrl (url) {
const parsed = new URL(url, 'http://localhost.com/')
const parsedPathname = parsed.pathname
return parsedPathname + (parsedPathname[parsedPathname.length - 1] !== '/' ? '/' : '') + (parsed.search || '')
} catch (error) {
} catch {
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
/* istanbul ignore next */
const err = new Error(`Invalid redirect URL: ${url}`)
Expand Down
6 changes: 3 additions & 3 deletions lib/dirList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const dirList = {
let stats
try {
stats = await fs.stat(path.join(dir, filename))
} catch (error) {
} catch {
return
}
const entry = { name: filename, stats }
Expand Down Expand Up @@ -58,7 +58,7 @@ const dirList = {
let stats
try {
stats = await fs.stat(filePath)
} catch (error) {
} catch {
return
}

Expand Down Expand Up @@ -112,7 +112,7 @@ const dirList = {
let entries
try {
entries = await dirList.list(dir, options, dotfiles)
} catch (error) {
} catch {
return reply.callNotFound()
}
const format = reply.request.query.format || options.format
Expand Down

0 comments on commit 8f4e793

Please sign in to comment.