Skip to content

Commit

Permalink
refactor(npm-conf): remove redundant check, add istanbul comments
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Dec 19, 2018
1 parent d58b741 commit 11c583c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/npm-conf/lib/npm-conf.js
Expand Up @@ -17,7 +17,7 @@ function npmConf(opts) {
// prevent keys with undefined values from obscuring defaults
const cleanOpts = opts
? Object.keys(opts).reduce((acc, key) => {
if (opts && opts[key] !== undefined) {
if (opts[key] !== undefined) {
// eslint-disable-next-line no-param-reassign
acc[key] = opts[key];
}
Expand All @@ -33,6 +33,7 @@ function npmConf(opts) {
const projectConf = path.resolve(conf.localPrefix, ".npmrc");
const userConf = conf.get("userconfig");

/* istanbul ignore else */
if (!conf.get("global") && projectConf !== userConf) {
conf.addFile(projectConf, "project");
} else {
Expand All @@ -41,6 +42,7 @@ function npmConf(opts) {

conf.addFile(conf.get("userconfig"), "user");

/* istanbul ignore else */
if (conf.get("prefix")) {
const etc = path.resolve(conf.get("prefix"), "etc");
conf.root.globalconfig = path.resolve(etc, "npmrc");
Expand All @@ -52,6 +54,7 @@ function npmConf(opts) {

const caFile = conf.get("cafile");

/* istanbul ignore if */
if (caFile) {
conf.loadCAFile(caFile);
}
Expand Down

0 comments on commit 11c583c

Please sign in to comment.