lib/core.js
function(options, serializedConnection)
    {
      // check for missing serializedConfig
      Errors.checkArgumentExists(Util.exists(serializedConnection),
          ErrorCodes.ERR_CONN_DESERIALIZE_MISSING_CONFIG);

      // check for invalid serializedConfig
      Errors.checkArgumentValid(Util.isString(serializedConnection),
          ErrorCodes.ERR_CONN_DESERIALIZE_INVALID_CONFIG_TYPE);

      // try to json-parse serializedConfig
      var config;
      try
      {
        config = JSON.parse(serializedConnection);
      }
      catch (err) {}
      finally
      {
        // if serializedConfig can't be parsed to json, throw an error
        Errors.checkArgumentValid(Util.isObject(config),
            ErrorCodes.ERR_CONN_DESERIALIZE_INVALID_CONFIG_FORM);
      }

      return createConnection(options, config);
    }
function(options, serializedConnection)
    {
      // check for missing serializedConfig
      Errors.checkArgumentExists(Util.exists(serializedConnection),
          ErrorCodes.ERR_CONN_DESERIALIZE_MISSING_CONFIG);

      // check for invalid serializedConfig
      Errors.checkArgumentValid(Util.isString(serializedConnection),
          ErrorCodes.ERR_CONN_DESERIALIZE_INVALID_CONFIG_TYPE);

      // try to json-parse serializedConfig
      var config;
      try
      {
        config = JSON.parse(serializedConnection);
      }
      catch (err) {}
      finally
      {
        // if serializedConfig can't be parsed to json, throw an error
        Errors.checkArgumentValid(Util.isObject(config),
            ErrorCodes.ERR_CONN_DESERIALIZE_INVALID_CONFIG_FORM);
      }

      return createConnection(options, config);
    }
function ( options , serializedConnection ) { // check for missing serializedConfig Errors . checkArgumentExists ( Util . exists ( serializedConnection ) , ErrorCodes . ERR_CONN_DESERIALIZE_MISSING_CONFIG ) ; // check for invalid serializedConfig Errors . checkArgumentValid ( Util . isString ( serializedConnection ) , ErrorCodes . ERR_CONN_DESERIALIZE_INVALID_CONFIG_TYPE ) ; // try to json-parse serializedConfig var config ; try { config = JSON . parse ( serializedConnection ) ; } catch ( err ) { } finally { // if serializedConfig can't be parsed to json, throw an error Errors . checkArgumentValid ( Util . isObject ( config ) , ErrorCodes . ERR_CONN_DESERIALIZE_INVALID_CONFIG_FORM ) ; } return createConnection ( options , config ) ; }
Deserializes a serialized connection.

@param {Object} options
@param {String} serializedConnection

@returns {Object}
Deserializes a serialized connection .