Skip to content

Commit

Permalink
- Minor refactoring: Remove options check in npm.js' `defaultPref…
Browse files Browse the repository at this point in the history
…ix` function as function does not later allow a non-object anyways

- Minor refactoring: Avoid else after throw
  • Loading branch information
brettz9 committed Oct 6, 2019
1 parent b84dd92 commit 6b030b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/package-managers/npm.js
Expand Up @@ -114,7 +114,7 @@ function spawnNpm(args, npmOptions={}, spawnOptions={}) {
*/
function defaultPrefix(options) {

if (options && options.prefix) {
if (options.prefix) {
return Promise.resolve(options.prefix);
}

Expand Down
3 changes: 2 additions & 1 deletion lib/version-util.js
Expand Up @@ -55,7 +55,8 @@ function precisionAdd(precision, n) {

if (index === null) {
throw new Error(`Invalid precision: ${precision}`);
} else if (!VERSION_PARTS[index]) {
}
if (!VERSION_PARTS[index]) {
throw new Error(`Invalid precision math${arguments}`);
}

Expand Down

0 comments on commit 6b030b8

Please sign in to comment.