Skip to content

Commit 07c7512

Browse files
committed
fix formatting
1 parent bcb0763 commit 07c7512

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class API {
257257
// Strip the headers, keep whitelist
258258
const strippedHeaders = Object.entries(response._headers).reduce((acc, [headerName, value]) => {
259259
if (!this._errorHeaderWhitelist.includes(headerName.toLowerCase())) return acc
260-
260+
261261
return {
262262
...acc,
263263
[headerName]: value
@@ -476,8 +476,10 @@ class API {
476476
// Execute the routing function
477477
fn(this,options)
478478

479-
// Remove the last prefix
480-
if(prefix.length) this._prefix = this._prefix.slice(0,-(prefix.length))
479+
// Remove the last prefix (if a prefix exists)
480+
if (prefix.length > 0) {
481+
this._prefix = this._prefix.slice(0,-(prefix.length))
482+
}
481483

482484
} // end register
483485

0 commit comments

Comments
 (0)