code: function mustBeNonEmptyObject(filter, keyword) {
    if (!filter || typeof filter !== 'object' || Array.isArray(filter)) {
      return Bluebird.reject(new BadRequestError(`"${keyword}" must be a non-empty object`));
    }
  
    const fields = Object.keys(filter);
  
    if (fields.length === 0) {
      return Bluebird.reject(new BadRequestError(`"${keyword}" must be a non-empty object`));
    }
  
    return Bluebird.resolve(fields);
  }
docs: Tests if "filter" is a non-object
  @param {object} filter
  @param {string} keyword
  @returns {Promise} Promise resolving to the object's keys