lib/transform/standardize.js
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);
}
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);
}
function mustBeNonEmptyObject ( filter , keyword ) { if ( ! filter || typeof filter !== 'object' || Array . isArray ( filter ) ) { return Bluebird . reject ( new BadRequestError ( ` ${ keyword } ` ) ) ; } const fields = Object . keys ( filter ) ; if ( fields . length === 0 ) { return Bluebird . reject ( new BadRequestError ( ` ${ keyword } ` ) ) ; } return Bluebird . resolve ( fields ) ; }
Tests if "filter" is a non-object
@param {object} filter
@param {string} keyword
@returns {Promise} Promise resolving to the object's keys
Tests if filter is a non - object