Skip to content

Commit

Permalink
refactor: simplify validate statement
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-sc committed Mar 15, 2017
1 parent 7be8def commit 03bfd92
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/sgcPrompt.js
Expand Up @@ -27,13 +27,7 @@ const sgcPrompt = () => {
type: 'input',
name: 'description',
message: 'Enter your commit message:',
validate: input => new Promise((resolve, reject) => {
if (input) {
resolve(true);
} else {
reject('A commit message is mandatory!');
}
}),
validate: input => (input ? true : 'A commit message is mandatory!'),
}, {
type: 'confirm',
name: 'moreInfo',
Expand Down

0 comments on commit 03bfd92

Please sign in to comment.