From 340278836d256bf3ff8591e8af0e5ca719e5543a Mon Sep 17 00:00:00 2001 From: Mohammad Fares Date: Sun, 14 Oct 2018 22:01:47 +0300 Subject: [PATCH] Add isSet() --- commands/share.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/commands/share.js b/commands/share.js index 6651add..be1d68c 100644 --- a/commands/share.js +++ b/commands/share.js @@ -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 *