lib/models/Room.js
function uniquenessValidator(values) {
  if (values.presentAuthors) {
    values = values.presentAuthors;
  }
  values.sort();

  for (var i = 0; i < values.length - 1; i++) {
    if (values[i] === values[i+1]) {
      // can throw error or return false
      // error allows supplying more detail
      throw new Error('Duplicate value [' + values[i] + '] found in Room.presentAuthors');
    }
  }

  return true;
}
function uniquenessValidator(values) {
  if (values.presentAuthors) {
    values = values.presentAuthors;
  }
  values.sort();

  for (var i = 0; i < values.length - 1; i++) {
    if (values[i] === values[i+1]) {
      // can throw error or return false
      // error allows supplying more detail
      throw new Error('Duplicate value [' + values[i] + '] found in Room.presentAuthors');
    }
  }

  return true;
}
function uniquenessValidator ( values ) { if ( values . presentAuthors ) { values = values . presentAuthors ; } values . sort ( ) ; for ( var i = 0 ; i < values . length - 1 ; i ++ ) { if ( values [ i ] === values [ i + 1 ] ) { // can throw error or return false // error allows supplying more detail throw new Error ( 'Duplicate value [' + values [ i ] + '] found in Room.presentAuthors' ) ; } } return true ; }
are all values unique?
are all values unique?