index.js
function JSONCookie (str) {
  if (typeof str !== 'string' || str.substr(0, 2) !== 'j:') {
    return undefined
  }

  try {
    return JSON.parse(str.slice(2))
  } catch (err) {
    return undefined
  }
}
function JSONCookie (str) {
  if (typeof str !== 'string' || str.substr(0, 2) !== 'j:') {
    return undefined
  }

  try {
    return JSON.parse(str.slice(2))
  } catch (err) {
    return undefined
  }
}
function JSONCookie ( str ) { if ( typeof str !== 'string' || str . substr ( 0 , 2 ) !== 'j:' ) { return undefined } try { return JSON . parse ( str . slice ( 2 ) ) } catch ( err ) { return undefined } }
Parse JSON cookie string.

@param {String} str
@return {Object} Parsed object or undefined if not json cookie
@public
Parse JSON cookie string .