Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: use default value for null options
  • Loading branch information
pvdlg committed Oct 8, 2018
1 parent 1b291d8 commit 92608a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/resolve-config.js
@@ -1,6 +1,6 @@
const {isUndefined} = require('lodash');
const {isNil} = require('lodash');

module.exports = ({changelogFile, changelogTitle}) => ({
changelogFile: isUndefined(changelogFile) ? 'CHANGELOG.md' : changelogFile,
changelogFile: isNil(changelogFile) ? 'CHANGELOG.md' : changelogFile,
changelogTitle,
});
4 changes: 2 additions & 2 deletions lib/verify.js
@@ -1,4 +1,4 @@
const {isString, isUndefined} = require('lodash');
const {isString, isNil} = require('lodash');
const AggregateError = require('aggregate-error');
const getError = require('./get-error');
const resolveConfig = require('./resolve-config');
Expand All @@ -15,7 +15,7 @@ module.exports = pluginConfig => {

const errors = Object.entries(options).reduce(
(errors, [option, value]) =>
!isUndefined(value) && value !== false && !VALIDATORS[option](value)
!isNil(value) && !VALIDATORS[option](value)
? [...errors, getError(`EINVALID${option.toUpperCase()}`, {[option]: value})]
: errors,
[]
Expand Down

0 comments on commit 92608a3

Please sign in to comment.