code: function(obj, required_props) {
          if(typeof obj === 'object') {
              required_props = required_props || Object.keys(obj);
              for (let prop of required_props) {
                  if (obj[prop] === undefined || obj[prop] === null || obj[prop] === '') {
                      throw new Error('Missing required property "' + prop + '"');
                  }
              }
          } else if(required_props && required_props.length > 0) {
              throw new Error('Missing required property "' + required_props + '"');
          } else if(obj === undefined || obj === null || obj === '') {
              throw new Error('The value cannot be empty');
          }
      }
docs: Performs an empty validation check on an object or scalar.
  This should only be used to validate string properties
  since invalid integers values are handled by the db schema.
  
  @param obj {{}|string} the object or string to be validated
  @param required_props {[string]} an array of required properties. default is all properties in obj. If obj is a scalar this should be the name of the property for reporting purposes.