Skip to content

Commit

Permalink
#984: validate added
Browse files Browse the repository at this point in the history
  • Loading branch information
phjulia committed Aug 30, 2023
1 parent fe22dca commit 0b43078
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/util/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ const Cli = {
type: 'input',
name: 'updateNotificationNotes',
message: `Please enter email addresses separated by a comma:`,
// eslint-disable-next-line jsdoc/require-jsdoc
validate: function (emails) {
const response = emails
.split(',')
.map((email) => {
if (!Util.emailValidator(email)) {
Util.logger.info(` ☇ skipping ${email}' - invalid email address`);
}
return email.trim();
})
.filter((email) => Util.emailValidator(email));
return response.length > 0;
},
}
);
try {
Expand Down

0 comments on commit 0b43078

Please sign in to comment.