Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydaly committed Oct 29, 2019
1 parent bcb0763 commit 07c7512
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class API {
// Strip the headers, keep whitelist
const strippedHeaders = Object.entries(response._headers).reduce((acc, [headerName, value]) => {
if (!this._errorHeaderWhitelist.includes(headerName.toLowerCase())) return acc

return {
...acc,
[headerName]: value
Expand Down Expand Up @@ -476,8 +476,10 @@ class API {
// Execute the routing function
fn(this,options)

// Remove the last prefix
if(prefix.length) this._prefix = this._prefix.slice(0,-(prefix.length))
// Remove the last prefix (if a prefix exists)
if (prefix.length > 0) {
this._prefix = this._prefix.slice(0,-(prefix.length))
}

} // end register

Expand Down

0 comments on commit 07c7512

Please sign in to comment.