UNPKG

@beamimpact/web-sdk

Version:

The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their

3 lines (2 loc) 657 B
const p=(e=document.cookie)=>e.split(";").reduce((i,n)=>{const o=n.trim(),[t,...a]=o.split("="),r=decodeURIComponent(a.join("="));return i.set(t,r)},new Map),m=e=>p().get(e),c=e=>{const{name:i,value:n,expires:o,...t}=e,a=encodeURIComponent(n),r=`${i}=${a}`,d=o!=null?` ;expires=${new Date(o).toUTCString()}`:"",l=Object.entries(t).map(([u,s])=>s!=null?` ;${u}=${s}`:"").join("");document.cookie=r+l+d},C=e=>{const{name:i,domain:n,path:o}=e,t={name:i,value:"",expires:0};return o!==void 0&&(t.path=o),n!==void 0&&(t.domain=n),c(t)};export{C as deleteCookieValue,p as getCookieMap,m as getCookieValue,c as setCookieValue}; //# sourceMappingURL=cookies.js.map