Skip to content

Commit

Permalink
feat: dev & peer dependency handling
Browse files Browse the repository at this point in the history
PR review feedback, the code is better for it :)
  • Loading branch information
ghinks committed Mar 6, 2021
1 parent 273d749 commit cb40834
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@ exports.checkPackageInPackageJSON = function checkPackageInPackageJSON (dep, pac
'optionalDependencies'
]
const checkKeyHasDep = (key) => Object.prototype.hasOwnProperty.call(packageJSON, key) && Object.prototype.hasOwnProperty.call(packageJSON[key], dep)
for (let i = 0; i < dependencyKeyNames.length; i++) {
if (checkKeyHasDep(dependencyKeyNames[i])) return dependencyKeyNames[i]
}
return false
return dependencyKeyNames.find(x => checkKeyHasDep(x))
}

0 comments on commit cb40834

Please sign in to comment.