packages/fbjs/src/useragent/UserAgent.js
function compare(name, version, query, normalizer) {
  // check for exact match with no version
  if (name === query) {
    return true;
  }

  // check for non-matching names
  if (!query.startsWith(name)) {
    return false;
  }

  // full comparison with version
  let range = query.slice(name.length);
  if (version) {
    range = normalizer ? normalizer(range) : range;
    return VersionRange.contains(range, version);
  }

  return false;
}
function compare(name, version, query, normalizer) {
  // check for exact match with no version
  if (name === query) {
    return true;
  }

  // check for non-matching names
  if (!query.startsWith(name)) {
    return false;
  }

  // full comparison with version
  let range = query.slice(name.length);
  if (version) {
    range = normalizer ? normalizer(range) : range;
    return VersionRange.contains(range, version);
  }

  return false;
}
function compare ( name , version , query , normalizer ) { // check for exact match with no version if ( name === query ) { return true ; } // check for non-matching names if ( ! query . startsWith ( name ) ) { return false ; } // full comparison with version let range = query . slice ( name . length ) ; if ( version ) { range = normalizer ? normalizer ( range ) : range ; return VersionRange . contains ( range , version ) ; } return false ; }
Checks to see whether `name` and `version` satisfy `query`.

@param {string} name Name of the browser, device, engine or platform
@param {?string} version Version of the browser, engine or platform
@param {string} query Query of form "Name [range expression]"
@param {?function} normalizer Optional pre-processor for range expression
@return {boolean}
Checks to see whether name and version satisfy query .