src/entitytypes.js
function(name, property, value, types) {
  if (!(types instanceof Array)) {
    types = [types];
  }
  if (types.indexOf(typeof value) === -1) {
    debug('%s \'%s\' expected %j got: %j', name, property, types, value);
    throw new Error(name + ' \'' + property + '\' expected one of type(s): \'' +
                    types.join(',') + '\' got type: \'' + typeof value + '\'');
  }
}
function(name, property, value, types) {
  if (!(types instanceof Array)) {
    types = [types];
  }
  if (types.indexOf(typeof value) === -1) {
    debug('%s \'%s\' expected %j got: %j', name, property, types, value);
    throw new Error(name + ' \'' + property + '\' expected one of type(s): \'' +
                    types.join(',') + '\' got type: \'' + typeof value + '\'');
  }
}
function ( name , property , value , types ) { if ( ! ( types instanceof Array ) ) { types = [ types ] ; } if ( types . indexOf ( typeof value ) === - 1 ) { debug ( '%s \'%s\' expected %j got: %j' , name , property , types , value ) ; throw new Error ( name + ' \'' + property + '\' expected one of type(s): \'' + types . join ( ',' ) + '\' got type: \'' + typeof value + '\'' ) ; } }
Check that value is of types for name and property Print messages and throw an error if the check fails
Check that value is of types for name and property Print messages and throw an error if the check fails