Skip to content

Commit

Permalink
Fix gulp-eslint error due to unexpected token (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioregueira authored Aug 13, 2020
1 parent da873c7 commit 9cbaff7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/mockRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,16 @@ function createRequest(options) {
* Subdomains are the dot-separated parts of the host before the main domain of the app.
*
*/
mockRequest.subdomains = (() => {

if (!mockRequest.headers.host) return [];
mockRequest.subdomains = (function() {
if (!mockRequest.headers.host) {
return [];
}

var offset = 2;
const subdomains = mockRequest.headers.host.split('.').reverse();
var subdomains = mockRequest.headers.host.split('.').reverse();

return subdomains.slice(offset);
})()
}());

return mockRequest;
}
Expand Down

0 comments on commit 9cbaff7

Please sign in to comment.