Better Validators and More Destucturing

This commit is contained in:
Daniel Odendahl Jr
2017-04-19 18:55:26 +00:00
parent c064401b37
commit d77f71b66a
40 changed files with 114 additions and 124 deletions
+2 -2
View File
@@ -18,10 +18,10 @@ module.exports = class MorseCommand extends Command {
prompt: 'What text would you like to convert to morse?',
type: 'string',
validate: content => {
if (translator.letterTrans(content, dictionary, ' ').length < 1900) {
if (translator.letterTrans(content, dictionary, ' ').length < 1999) {
return true;
}
return 'Your text to encode is too long.';
return 'Your message content is too long.';
},
parse: text => {
return translator.letterTrans(text.toLowerCase(), dictionary, ' ');