src/RefocusCollectorEval.js
function acceptMatcher(acc, actual) {
  /* Exact match or full wildcard match on both type and subtype */
  if (actual.contentType === acc.item || acc.item === '*/*') return true;

  /* Otherwise check for "*" wildcard matches */
  const a = acc.item.split(MIME_SUBTYPE_SEPARATOR);
  const accepted = {
    type: a[0],
    subtype: a[1],
  };

  /* Exact match type, wildcard subtype */
  if (actual.type === accepted.type && accepted.subtype === '*') {
    return true;
  }

  /* Wildcard type, exact match subtype */
  if (accepted.type === '*' && accepted.subtype === actual.subtype) {
    return true;
  }
}
function acceptMatcher(acc, actual) {
  /* Exact match or full wildcard match on both type and subtype */
  if (actual.contentType === acc.item || acc.item === '*/*') return true;

  /* Otherwise check for "*" wildcard matches */
  const a = acc.item.split(MIME_SUBTYPE_SEPARATOR);
  const accepted = {
    type: a[0],
    subtype: a[1],
  };

  /* Exact match type, wildcard subtype */
  if (actual.type === accepted.type && accepted.subtype === '*') {
    return true;
  }

  /* Wildcard type, exact match subtype */
  if (accepted.type === '*' && accepted.subtype === actual.subtype) {
    return true;
  }
}
function acceptMatcher ( acc , actual ) { /* Exact match or full wildcard match on both type and subtype */ if ( actual . contentType === acc . item || acc . item === '*/*' ) return true ; /* Otherwise check for "*" wildcard matches */ const a = acc . item . split ( MIME_SUBTYPE_SEPARATOR ) ; const accepted = { type : a [ 0 ] , subtype : a [ 1 ] , } ; /* Exact match type, wildcard subtype */ if ( actual . type === accepted . type && accepted . subtype === '*' ) { return true ; } /* Wildcard type, exact match subtype */ if ( accepted . type === '*' && accepted . subtype === actual . subtype ) { return true ; } }
Checks whether the actual content type matches this particular accepted
type.

@param {Object} acc - one of the array elements returned by parsing the
Accept headers using "accept-parser"
@param {Object} actual - An object representing the actual content type
received, with attributes ["contentType", "type", "subtype"]
@returns {Boolean} true if the actual content type matches this particular
"Accept" entry, either an exact match or a wildcard match
Checks whether the actual content type matches this particular accepted type .