Skip to content

Commit 3a39933

Browse files
committed
Simplify validate function
1 parent ee1914e commit 3a39933

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

generators/app/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@ module.exports = generators.Base.extend({
5555
name: 'projectURL',
5656
message: chalk.yellow('If you will be using Github Pages, use username.github.io\n') +
5757
chalk.yellow('? ') + 'What will the URL for your project be?',
58-
validate: function (input) {
59-
if (input.startsWith('http')) {
60-
return true;
61-
}
62-
63-
return 'URL must contain either HTTP or HTTPs';
64-
},
58+
validate: i => i.startsWith('http') ? true : 'URL must contain either HTTP or HTTPs',
6559
store: true
6660
}, {
6761
name: 'authorName',

0 commit comments

Comments
 (0)