@claspo/common 7.0.3-rc0 → 7.0.3-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/common",
3
- "version": "7.0.3rc0",
3
+ "version": "7.0.3-rc1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1 +1 @@
1
- import BaseCachingStorage from"./BaseCachingStorage";class CachingCookieStorage extends BaseCachingStorage{get(e){const o=this._getFromCache(e);return null!==o?o:this._process(()=>{const o=e.replace(/([$?*|{}()[\]\\/+^])/g,"\\$1"),t=document.cookie.match(new RegExp("(?:^|; )"+o+"=([^;]*)")),n=t?decodeURIComponent(t[1]):null;return this._setToCache(e,n),n})}set(e,o,t={}){const n=Object.assign({path:"/",expires:new Date((new Date).getFullYear()+5,0)},t);n.expires instanceof Date&&(n.expires=n.expires.toUTCString());let s=encodeURIComponent(e)+"="+encodeURIComponent(o);for(const e in n){s+="; "+e;const o=n[e];!0!==o&&(s+="="+o)}const c="string"==typeof o?o:this._process(()=>JSON.stringify(o));this._setToCache(e,c),this._process(()=>(document.cookie=s,null))}remove(e){this._removeFromCache(e),this._process(()=>(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",null))}}export default new CachingCookieStorage;
1
+ import BaseCachingStorage from"./BaseCachingStorage";class CachingCookieStorage extends BaseCachingStorage{get(e){const o=this._getFromCache(e);return null!==o?o:this._process(()=>{let o=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));const t=o?decodeURIComponent(o[1]):null;return this._setToCache(e,t),t})}set(e,o,t={}){const n=Object.assign({path:"/",expires:new Date((new Date).getFullYear()+5,0)},t);n.expires instanceof Date&&(n.expires=n.expires.toUTCString());let s=encodeURIComponent(e)+"="+encodeURIComponent(o);for(const e in n){s+="; "+e;const o=n[e];!0!==o&&(s+="="+o)}const c="string"==typeof o?o:this._process(()=>JSON.stringify(o));this._setToCache(e,c),this._process(()=>(document.cookie=s,null))}remove(e){this._removeFromCache(e),this._process(()=>(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",null))}}export default new CachingCookieStorage;