dist/app.4d46c0f9.js
/**
 * ### .compatibleMessage(thrown, errMatcher)
 *
 * Checks if an error's message is compatible with a matcher (String or RegExp).
 * If the message contains the String or passes the RegExp test,
 * it is considered compatible.
 *
 * @name compatibleMessage
 * @param {Error} thrown error
 * @param {String|RegExp} errMatcher to look for into the message
 * @namespace Utils
 * @api public
 */
.compatibleMessage(thrown, errMatcher)
Checks if an error's message is compatible with a matcher (String or RegExp).
If the message contains the String or passes the RegExp test,
it is considered compatible.


. compatibleMessage ( thrown errMatcher ) Checks if an error ' s message is compatible with a matcher ( String or RegExp ) . If the message contains the String or passes the RegExp test it is considered compatible .
function compatibleMessage(thrown, errMatcher) {
  var comparisonString = typeof thrown === 'string' ? thrown : thrown.message;
  if (errMatcher instanceof RegExp) {
    return errMatcher.test(comparisonString);
  } else if (typeof errMatcher === 'string') {
    return comparisonString.indexOf(errMatcher) !== -1; 
  }
  return false;
}
function compatibleMessage ( thrown , errMatcher ) { var comparisonString = typeof thrown === 'string' ? thrown : thrown . message ; if ( errMatcher instanceof RegExp ) { return errMatcher . test ( comparisonString ) ; } else if ( typeof errMatcher === 'string' ) { return comparisonString . indexOf ( errMatcher ) !== - 1 ; } return false ; }
### .compatibleMessage(thrown, errMatcher)
 Checks if an error's message is compatible with a matcher (String or RegExp).
### . compatibleMessage ( thrown errMatcher ) Checks if an error ' s message is compatible with a matcher ( String or RegExp ) .
// eslint-disable-line no-magic-numbers