Add isSet()

This commit is contained in:
Mohammad Fares 2018-10-14 22:01:47 +03:00
parent 7b2513c5fd
commit 340278836d
1 changed files with 18 additions and 0 deletions

View File

@ -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 * The command's main function
* *