Skip to content

Commit

Permalink
Don't check for defined in isService since we do that beforehand
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerddal-pti committed Oct 13, 2021
1 parent 58f9679 commit f0395f9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/utils.js
Expand Up @@ -145,19 +145,11 @@ function getShortServiceNameFromPath (path) {
}

function isService (v) {
if (v && v.service) {
const vKeys = Object.keys(v.service)
v = v.service || v
const vKeys = Object.keys(v)

return vKeys.length > 0 && v.service[vKeys[0]] && v.service[vKeys[0]].path &&
typeof v.service[vKeys[0]].path === 'string' && v.service[vKeys[0]].path[0] === '/'
} else if (v) {
const vKeys = Object.keys(v)

return vKeys.length > 0 && v[vKeys[0]] && v[vKeys[0]].path &&
typeof v[vKeys[0]].path === 'string' && v[vKeys[0]].path[0] === '/'
}

return false
return vKeys.length > 0 && v[vKeys[0]] && v[vKeys[0]].path &&
typeof v[vKeys[0]].path === 'string' && v[vKeys[0]].path[0] === '/'
}

module.exports = {
Expand Down

0 comments on commit f0395f9

Please sign in to comment.