function tlsChannelIdValue(opt_tlsChannelId) {
  if (!opt_tlsChannelId) {
    // Case 1: Always set some value for TLS channel ID, even if it's the empty
    // string: this browser definitely supports them.
    return UNUSED_CID_PUBKEY_VALUE;
  }
  if (typeof opt_tlsChannelId === 'string') {
    try {
      var obj = JSON.parse(opt_tlsChannelId);
      if (!obj) {
        // Case 1: The string value 'null' parses as the Javascript object null,
        // so return an empty string: the browser definitely supports TLS
        // channel id.
        return UNUSED_CID_PUBKEY_VALUE;
      }
      // Case 2: return the value as a JS object.
      return /** @type {Object} */ (obj);
    } catch (e) {
      console.warn('Unparseable TLS channel ID value ' + opt_tlsChannelId);
      // Case 3: return the value unmodified.
    }
  }
  return opt_tlsChannelId;
}
/**
 * Normalizes the TLS channel ID value:
 * 1. Converts semantically empty values (undefined, null, 0) to the empty
 *     string.
 * 2. Converts valid JSON strings to a JS object.
 * 3. Otherwise, returns the input value unmodified.
 * @param {Object|string|undefined} opt_tlsChannelId TLS Channel id
 * @return {Object|string} The normalized TLS channel ID value.
 */
Normalizes the TLS channel ID value:
1. Converts semantically empty values (undefined, null, 0) to the empty
string.
2. Converts valid JSON strings to a JS object.
3. Otherwise, returns the input value unmodified.
@param {Object|string|undefined} opt_tlsChannelId TLS Channel id
@return {Object|string} The normalized TLS channel ID value.
Normalizes the TLS channel ID value : 1 . Converts semantically empty values ( undefined null 0 ) to the empty string . 2 . Converts valid JSON strings to a JS object . 3 . Otherwise returns the input value unmodified . @param { Object|string|undefined } opt_tlsChannelId TLS Channel id @return { Object|string } The normalized TLS channel ID value .
function tlsChannelIdValue(opt_tlsChannelId) {
  if (!opt_tlsChannelId) {
    return UNUSED_CID_PUBKEY_VALUE;
  }
  if (typeof opt_tlsChannelId === 'string') {
    try {
      var obj = JSON.parse(opt_tlsChannelId);
      if (!obj) {
        return UNUSED_CID_PUBKEY_VALUE;
      }
      return  (obj);
    } catch (e) {
      console.warn('Unparseable TLS channel ID value ' + opt_tlsChannelId);
    }
  }
  return opt_tlsChannelId;
}
function tlsChannelIdValue ( opt_tlsChannelId ) { if ( ! opt_tlsChannelId ) { return UNUSED_CID_PUBKEY_VALUE ; } if ( typeof opt_tlsChannelId === 'string' ) { try { var obj = JSON . parse ( opt_tlsChannelId ) ; if ( ! obj ) { return UNUSED_CID_PUBKEY_VALUE ; } return ( obj ) ; } catch ( e ) { console . warn ( 'Unparseable TLS channel ID value ' + opt_tlsChannelId ) ; } } return opt_tlsChannelId ; }
Normalizes the TLS channel ID value:
 1.
Normalizes the TLS channel ID value : 1 .
// Case 1: Always set some value for TLS channel ID, even if it's the empty // string: this browser definitely supports them. // Case 1: The string value 'null' parses as the Javascript object null, // so return an empty string: the browser definitely supports TLS // channel id. // Case 2: return the value as a JS object. /** @type {Object} */ // Case 3: return the value unmodified.