lib/configuration.js
function validate(key, values) {
  var typedef, value;

  if(!~Keys.indexOf(key)) {
    throw new Error('unknown configuration key: ' + key);
  }

  // retrieve the type definition
  typedef = Types[key];

  // validate on the typedef
  try {
    value = typedef.validate(key, values);
  }catch(e) {
    // got a more specific error message to throw
    if(typeof validator[key] === 'object'
      && validator[key].error) {
      throw validator[key].error;
    }
    throw e;
  }

  return value;
}
function validate(key, values) {
  var typedef, value;

  if(!~Keys.indexOf(key)) {
    throw new Error('unknown configuration key: ' + key);
  }

  // retrieve the type definition
  typedef = Types[key];

  // validate on the typedef
  try {
    value = typedef.validate(key, values);
  }catch(e) {
    // got a more specific error message to throw
    if(typeof validator[key] === 'object'
      && validator[key].error) {
      throw validator[key].error;
    }
    throw e;
  }

  return value;
}
function validate ( key , values ) { var typedef , value ; if ( ! ~ Keys . indexOf ( key ) ) { throw new Error ( 'unknown configuration key: ' + key ) ; } // retrieve the type definition typedef = Types [ key ] ; // validate on the typedef try { value = typedef . validate ( key , values ) ; } catch ( e ) { // got a more specific error message to throw if ( typeof validator [ key ] === 'object' && validator [ key ] . error ) { throw validator [ key ] . error ; } throw e ; } return value ; }
Validate a key and array of values.

@param key The configuration key.
@param values The array of string values.
Validate a key and array of values .