normalizeParams(configurations) {
        configurations.forEach((params)=>{
            Object.keys(params).forEach((key)=>{
                let value = params[key];
                if (value.length > 1) throw new Error(`Parameter "${key}" must have only a single value`);
                value = value[0];
                if (key === 'client_max_window_bits') {
                    if (value !== true) {
                        const num = +value;
                        if (!Number.isInteger(num) || num < 8 || num > 15) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                        value = num;
                    } else if (!this._isServer) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                } else if (key === 'server_max_window_bits') {
                    const num = +value;
                    if (!Number.isInteger(num) || num < 8 || num > 15) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                    value = num;
                } else if (key === 'client_no_context_takeover' || key === 'server_no_context_takeover') {
                    if (value !== true) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                } else throw new Error(`Unknown parameter "${key}"`);
                params[key] = value;
            });
        });
        return configurations;
    }
/**
   * Normalize parameters.
   *
   * @param {Array} configurations The extension negotiation offers/reponse
   * @return {Array} The offers/response with normalized parameters
   * @private
   */
Normalize parameters.
@param {Array} configurations The extension negotiation offers/reponse
@return {Array} The offers/response with normalized parameters
@private
Normalize parameters . @param { Array } configurations The extension negotiation offers / reponse @return { Array } The offers / response with normalized parameters @private
normalizeParams(configurations) {
        configurations.forEach((params)=>{
            Object.keys(params).forEach((key)=>{
                let value = params[key];
                if (value.length > 1) throw new Error(`Parameter "${key}" must have only a single value`);
                value = value[0];
                if (key === 'client_max_window_bits') {
                    if (value !== true) {
                        const num = +value;
                        if (!Number.isInteger(num) || num < 8 || num > 15) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                        value = num;
                    } else if (!this._isServer) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                } else if (key === 'server_max_window_bits') {
                    const num = +value;
                    if (!Number.isInteger(num) || num < 8 || num > 15) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                    value = num;
                } else if (key === 'client_no_context_takeover' || key === 'server_no_context_takeover') {
                    if (value !== true) throw new TypeError(`Invalid value for parameter "${key}": ${value}`);
                } else throw new Error(`Unknown parameter "${key}"`);
                params[key] = value;
            });
        });
        return configurations;
    }
normalizeParams ( configurations ) { configurations . forEach ( ( params ) => { Object . keys ( params ) . forEach ( ( key ) => { let value = params [ key ] ; if ( value . length > 1 ) throw new Error ( ` ${ key } ` ) ; value = value [ 0 ] ; if ( key === 'client_max_window_bits' ) { if ( value !== true ) { const num = + value ; if ( ! Number . isInteger ( num ) || num < 8 || num > 15 ) throw new TypeError ( ` ${ key } ${ value } ` ) ; value = num ; } else if ( ! this . _isServer ) throw new TypeError ( ` ${ key } ${ value } ` ) ; } else if ( key === 'server_max_window_bits' ) { const num = + value ; if ( ! Number . isInteger ( num ) || num < 8 || num > 15 ) throw new TypeError ( ` ${ key } ${ value } ` ) ; value = num ; } else if ( key === 'client_no_context_takeover' || key === 'server_no_context_takeover' ) { if ( value !== true ) throw new TypeError ( ` ${ key } ${ value } ` ) ; } else throw new Error ( ` ${ key } ` ) ; params [ key ] = value ; } ) ; } ) ; return configurations ; }
Normalize parameters.
Normalize parameters .