This commit is contained in:
Daniel Odendahl Jr
2018-03-23 22:35:21 +00:00
parent 9b8cc68b97
commit 0702a2d459
15 changed files with 48 additions and 96 deletions
+2 -8
View File
@@ -22,20 +22,14 @@ module.exports = class CurrencyCommand extends Command {
key: 'base',
prompt: `What currency code do you want to use as the base? Either ${list(codes, 'or')}.`,
type: 'string',
validate: base => {
if (codes.includes(base.toUpperCase())) return true;
return `Invalid base, please enter either ${list(codes, 'or')}.`;
},
oneOf: codes,
parse: base => base.toUpperCase()
},
{
key: 'target',
prompt: `What currency code do you want to convert to? Either ${list(codes, 'or')}.`,
type: 'string',
validate: target => {
if (codes.includes(target.toUpperCase())) return true;
return `Invalid target, please enter either ${list(codes, 'or')}.`;
},
oneOf: codes,
parse: target => target.toUpperCase()
}
]