code: function get(key, decoder = decodeURIComponent) {
    if ((typeof key !== 'string') || !key) {
      return null;
    }
  
    const reKey = new RegExp(`(?:^|; )${escapeRe(key)}(?:=([^;]*))?(?:;|$)`);
    const match = reKey.exec(document.cookie);
  
    if (match === null) {
      return null;
    }
  
    return typeof decoder === 'function' ? decoder(match[1]) : match[1];
  }
docs: Get the cookie value by key.