Add isSet()
This commit is contained in:
parent
7b2513c5fd
commit
340278836d
|
@ -19,6 +19,24 @@ function done(url) {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the value is not an empty value
|
||||
*
|
||||
* - Throw `Required field` if empty
|
||||
*
|
||||
* @param {String} input
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function isSet(input) {
|
||||
|
||||
if (!input) {
|
||||
return new Error('Required field');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The command's main function
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue