export function getCookie(name) {
  var cookie = document.cookie,
    pattern = /([^=]+)=([^;]+);?\s*/g,
    result,
    value = {}
  while ((result = pattern.exec(cookie)) != null) {
    value[result[1]] = result[2]
  }
  return value[name]
}