function parseEncoding(str, i) {
  const match = simpleEncodingRegExp.exec(str);
  if (!match) return null;
  const encoding = match[1];
  let q = 1;
  if (match[2]) {
    const params = match[2].split(";");
    for (var j = 0; j < params.length; j++) {
      const p = params[j].trim().split("=");
      if (p[0] === "q") {
        q = parseFloat(p[1]);
        break;
      }
    }
  }
  return {
    encoding,
    q: q,
    i: i,
  };
}
/**
 * Parse an encoding from the Accept-Encoding header.
 */
Parse an encoding from the Accept-Encoding header.
Parse an encoding from the Accept - Encoding header .
function parseEncoding(str, i) {
  const match = simpleEncodingRegExp.exec(str);
  if (!match) return null;
  const encoding = match[1];
  let q = 1;
  if (match[2]) {
    const params = match[2].split(";");
    for (var j = 0; j < params.length; j++) {
      const p = params[j].trim().split("=");
      if (p[0] === "q") {
        q = parseFloat(p[1]);
        break;
      }
    }
  }
  return {
    encoding,
    q: q,
    i: i,
  };
}
function parseEncoding ( str , i ) { const match = simpleEncodingRegExp . exec ( str ) ; if ( ! match ) return null ; const encoding = match [ 1 ] ; let q = 1 ; if ( match [ 2 ] ) { const params = match [ 2 ] . split ( ";" ) ; for ( var j = 0 ; j < params . length ; j ++ ) { const p = params [ j ] . trim ( ) . split ( "=" ) ; if ( p [ 0 ] === "q" ) { q = parseFloat ( p [ 1 ] ) ; break ; } } } return { encoding , q : q , i : i , } ; }
Parse an encoding from the Accept-Encoding header.
Parse an encoding from the Accept - Encoding header .