mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 21:46:29 +00:00
Formatting
This commit is contained in:
parent
48b0ed4b8e
commit
cf3ca62b9d
1 changed files with 4 additions and 4 deletions
|
@ -34,19 +34,19 @@ function getQuestions(options, username, contributions) {
|
||||||
answers.username = answers.username || username;
|
answers.username = answers.username || username;
|
||||||
return options.contributors
|
return options.contributors
|
||||||
.filter((entry) => entry.login.toLowerCase() === answers.username.toLowerCase())
|
.filter((entry) => entry.login.toLowerCase() === answers.username.toLowerCase())
|
||||||
.reduce((memo, entry) => memo.concat(entry.contributions), []);
|
.reduce((allEntries, entry) => allEntries.concat(entry.contributions), []);
|
||||||
},
|
},
|
||||||
choices: contributionChoices(options),
|
choices: contributionChoices(options),
|
||||||
validate: function (input, answers) {
|
validate: function (input, answers) {
|
||||||
answers.username = answers.username || username;
|
answers.username = answers.username || username;
|
||||||
var previousContributions = options.contributors
|
var previousContributions = options.contributors
|
||||||
.filter((entry) => entry.login.toLowerCase() === answers.username.toLowerCase())
|
.filter((entry) => entry.login.toLowerCase() === answers.username.toLowerCase())
|
||||||
.reduce((memo, entry) => memo.concat(entry.contributions), []);
|
.reduce((allEntries, entry) => allEntries.concat(entry.contributions), []);
|
||||||
|
|
||||||
if (!input.length) {
|
if (!input.length) {
|
||||||
return 'Use space to select at least one contribution type.'
|
return 'Use space to select at least one contribution type.';
|
||||||
} else if (_.isEqual(input, previousContributions)) {
|
} else if (_.isEqual(input, previousContributions)) {
|
||||||
return 'Nothing changed, use space to select contribution types.'
|
return 'Nothing changed, use space to select contribution types.';
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue