diff --git a/CHANGELOG.md b/CHANGELOG.md index 64e62cd..5c0f006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ +## 2.3.2 + +### Improvements + +1. Added an optional parameter to `getItem(key, noParse)` method + to determine if the value shouldn't be parsed with `JSON.parse` + ## 2.3.0 ### Improvements diff --git a/README.md b/README.md index ca4481f..67920ac 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ $ yarn add proxy-storage - + ``` In the above case, [`proxyStorage`](#api) is included as a global object @@ -153,7 +153,8 @@ the prototype: - **`setItem`**`(key, value [,options])`: stores a `value` given a `key` name.
The `options` parameter is used only with instances of `cookieStorage`. Read more details [here](#handling-cookies). -- **`getItem`**`(key)`: retrieves a value by its `key` name. +- **`getItem`**`(key [, noParse])`: retrieves a value by its `key` name. +
If `noParse` is `true` then the value retrieved is not parsed with `JSON.parse`. - **`removeItem`**`(key [,options])`: deletes an item from the storage.
The `options` parameter is used only with instances of `cookieStorage`. Read more details [here](#handling-cookies). @@ -190,6 +191,9 @@ storage.setItem('qwerty', [{ garbage: true, some: 'object' }]); console.log(storage.getItem('qwerty')); // [{ garbage: true, some: 'object' }] +console.log(storage.getItem('qwerty', true)); +// '[{ "garbage": true, "some": "object" }]' + storage.setItem('persisted', true); storage.setItem('o-really', { status: 'saved' }); console.log(`items: ${storage.length}`); @@ -237,7 +241,8 @@ Each instance inherits the following properties: - **`setItem`**`(key, value [,options])`: stores a `value` given a `key` name.
The `options` parameter is used only with instances of `cookieStorage`. Read more details [here](#handling-cookies). -- **`getItem`**`(key)`: retrieves a value by its `key` name. +- **`getItem`**`(key [, noParse])`: retrieves a value by its `key` name. +
If `noParse` is `true` then the value retrieved is not parsed with `JSON.parse`. - **`removeItem`**`(key [,options])`: deletes an item from the storage.
The `options` parameter is used only with instances of `cookieStorage`. Read more details [here](#handling-cookies). diff --git a/dist/proxy-storage.js b/dist/proxy-storage.js index 5df00cd..c7c50f2 100644 --- a/dist/proxy-storage.js +++ b/dist/proxy-storage.js @@ -1,4 +1,4 @@ -/*! proxyStorage@v2.3.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ +/*! proxyStorage@v2.3.2. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -468,6 +468,7 @@ var WebStorage = function () { * Retrieves a value by its key name. * * @param {string} key: keyname of the storage + * @param {boolean} noParse: if the value shoudn't be parsed with `JSON.parse` * @return {void} * * @memberOf WebStorage @@ -475,7 +476,7 @@ var WebStorage = function () { }, { key: 'getItem', - value: function getItem(key) { + value: function getItem(key, noParse) { (0, _utils.checkEmpty)(key); var value = _proxyMechanism.proxy[this.__storage__].getItem(key); if (value == null) { @@ -483,7 +484,7 @@ var WebStorage = function () { delete this[key]; value = null; } else { - value = (0, _utils.tryParse)(value); + if (noParse !== true) value = (0, _utils.tryParse)(value); this[key] = value; } var v = (0, _interceptors2.default)('getItem', key, value); diff --git a/dist/proxy-storage.min.js b/dist/proxy-storage.min.js index eaaefb5..3bcc882 100644 --- a/dist/proxy-storage.min.js +++ b/dist/proxy-storage.min.js @@ -1,3 +1,3 @@ -/*! proxyStorage@v2.3.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxyStorage=t():e.proxyStorage=t()}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";function o(e){return"[object Object]"===Object.prototype.toString.call(e)}function n(e){if(null==e||""===e)throw new Error("The key provided can not be empty")}function i(e,t,r){var o={configurable:!1,enumerable:!1,writable:!1};void 0!==r&&(o.value=r),Object.defineProperty(e,t,o)}function a(e){var t=void 0;try{t=JSON.parse(e)}catch(r){t=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.checkEmpty=n,t.setProperty=i,t.tryParse=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isAvailable={localStorage:!1,cookieStorage:!1,sessionStorage:!1,memoryStorage:!0}},function(e,t,r){"use strict";function o(e){var t=i.proxy[e],r="__proxy-storage__";try{t.setItem(r,r),t.removeItem(r)}catch(e){return!1}return!0}function n(e){return u.isAvailable[e]&&(i.webStorageSettings.default=e,c.set(e)),u.isAvailable[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=t.configStorage=t.WebStorage=t.default=void 0;var i=r(3),a=function(e){return e&&e.__esModule?e:{default:e}}(i),u=r(1),s=null,c={get:function(){return s.__storage__},set:function(e){t.default=s=new a.default(e)}};!function(){u.isAvailable.localStorage=o("localStorage"),u.isAvailable.cookieStorage=o("cookieStorage"),u.isAvailable.sessionStorage=o("sessionStorage"),i.webStorageSettings.isAvailable=u.isAvailable,Object.keys(u.isAvailable).some(n)}(),t.default=s,t.WebStorage=a.default,t.configStorage=c,t.isAvailable=u.isAvailable},function(e,t,r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return Object.keys(t).forEach(function(r){e[r]=(0,c.tryParse)(t[r])}),e}function i(e){if(p.isAvailable[e])return e;var t="sessionStorage"===e?"memoryStorage":p.default,r=e+" is not available. Falling back to "+t;return console.warn(r),t}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=t.webStorageSettings=t.default=void 0;var a=function(){function e(e,t){for(var r=0;r1?t-1:0),o=1;o-1&&(t=o.substring(0,r),e.removeItem(t.trim()))})}};return a(e)}function a(e){for(var t in e)(0,u.setProperty)(e,t);return d.get().split(";").forEach(function(t){var r=t.indexOf("="),o=t.substring(0,r).trim(),n=t.substring(r+1).trim();o&&(e[o]=decodeURIComponent(n))}),e}Object.defineProperty(t,"__esModule",{value:!0});var u=r(0),s=r(7),c=o(s),l=r(8),f=o(l),d={get:function(){return document.cookie},set:function(e){document.cookie=e},data:{}};t.default=i},function(e,t,r){"use strict";function o(e,t){return t[e]?";"+e+"="+t[e]:""}function n(e){return""+o("expires",e)+o("domain",e)+o("path",e)+(e.secure?";secure":"")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},e),r=t.date instanceof Date?t.date:new Date;return+t.minutes&&r.setMinutes(r.getMinutes()+t.minutes),+t.hours&&r.setHours(r.getHours()+t.hours),+t.days&&r.setDate(r.getDate()+t.days),+t.months&&r.setMonth(r.getMonth()+t.months),+t.years&&r.setFullYear(r.getFullYear()+t.years),r}function n(e){return o(e instanceof Date?{date:e}:e).toUTCString()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=void 0;try{e=JSON.parse(window.self.name)}catch(e){return{}}return e&&"object"===(void 0===e?"undefined":u(e))?e:{}}function n(e){var t=JSON.stringify(e);window.self.name=t}function i(){var e=o();return a({setItem:function(t,r){e[t]=r,n(e)},getItem:function(t){var r=e[t];return void 0===r?null:r},removeItem:function(t){delete e[t],n(e)},clear:function(){Object.keys(e).forEach(function(t){return delete e[t]}),n(e)}},e)}function a(e,t){for(var r in e)(0,s.setProperty)(e,r);return Object.assign(e,t),e}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=i;var s=r(0)}])}); +/*! proxyStorage@v2.3.2. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxyStorage=t():e.proxyStorage=t()}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";function o(e){return"[object Object]"===Object.prototype.toString.call(e)}function n(e){if(null==e||""===e)throw new Error("The key provided can not be empty")}function i(e,t,r){var o={configurable:!1,enumerable:!1,writable:!1};void 0!==r&&(o.value=r),Object.defineProperty(e,t,o)}function a(e){var t=void 0;try{t=JSON.parse(e)}catch(r){t=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.checkEmpty=n,t.setProperty=i,t.tryParse=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isAvailable={localStorage:!1,cookieStorage:!1,sessionStorage:!1,memoryStorage:!0}},function(e,t,r){"use strict";function o(e){var t=i.proxy[e],r="__proxy-storage__";try{t.setItem(r,r),t.removeItem(r)}catch(e){return!1}return!0}function n(e){return u.isAvailable[e]&&(i.webStorageSettings.default=e,c.set(e)),u.isAvailable[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=t.configStorage=t.WebStorage=t.default=void 0;var i=r(3),a=function(e){return e&&e.__esModule?e:{default:e}}(i),u=r(1),s=null,c={get:function(){return s.__storage__},set:function(e){t.default=s=new a.default(e)}};!function(){u.isAvailable.localStorage=o("localStorage"),u.isAvailable.cookieStorage=o("cookieStorage"),u.isAvailable.sessionStorage=o("sessionStorage"),i.webStorageSettings.isAvailable=u.isAvailable,Object.keys(u.isAvailable).some(n)}(),t.default=s,t.WebStorage=a.default,t.configStorage=c,t.isAvailable=u.isAvailable},function(e,t,r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return Object.keys(t).forEach(function(r){e[r]=(0,c.tryParse)(t[r])}),e}function i(e){if(p.isAvailable[e])return e;var t="sessionStorage"===e?"memoryStorage":p.default,r=e+" is not available. Falling back to "+t;return console.warn(r),t}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=t.webStorageSettings=t.default=void 0;var a=function(){function e(e,t){for(var r=0;r1?t-1:0),o=1;o-1&&(t=o.substring(0,r),e.removeItem(t.trim()))})}};return a(e)}function a(e){for(var t in e)(0,u.setProperty)(e,t);return d.get().split(";").forEach(function(t){var r=t.indexOf("="),o=t.substring(0,r).trim(),n=t.substring(r+1).trim();o&&(e[o]=decodeURIComponent(n))}),e}Object.defineProperty(t,"__esModule",{value:!0});var u=r(0),s=r(7),c=o(s),l=r(8),f=o(l),d={get:function(){return document.cookie},set:function(e){document.cookie=e},data:{}};t.default=i},function(e,t,r){"use strict";function o(e,t){return t[e]?";"+e+"="+t[e]:""}function n(e){return""+o("expires",e)+o("domain",e)+o("path",e)+(e.secure?";secure":"")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},e),r=t.date instanceof Date?t.date:new Date;return+t.minutes&&r.setMinutes(r.getMinutes()+t.minutes),+t.hours&&r.setHours(r.getHours()+t.hours),+t.days&&r.setDate(r.getDate()+t.days),+t.months&&r.setMonth(r.getMonth()+t.months),+t.years&&r.setFullYear(r.getFullYear()+t.years),r}function n(e){return o(e instanceof Date?{date:e}:e).toUTCString()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function o(){var e=void 0;try{e=JSON.parse(window.self.name)}catch(e){return{}}return e&&"object"===(void 0===e?"undefined":u(e))?e:{}}function n(e){var t=JSON.stringify(e);window.self.name=t}function i(){var e=o();return a({setItem:function(t,r){e[t]=r,n(e)},getItem:function(t){var r=e[t];return void 0===r?null:r},removeItem:function(t){delete e[t],n(e)},clear:function(){Object.keys(e).forEach(function(t){return delete e[t]}),n(e)}},e)}function a(e,t){for(var r in e)(0,s.setProperty)(e,r);return Object.assign(e,t),e}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=i;var s=r(0)}])}); //# sourceMappingURL=proxy-storage.min.map \ No newline at end of file diff --git a/dist/proxy-storage.min.map b/dist/proxy-storage.min.map index 74fdef0..221df6e 100644 --- a/dist/proxy-storage.min.map +++ b/dist/proxy-storage.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap fd32f1307368e64ca7b0","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/proxy-storage.js","webpack:///./src/web-storage.js","webpack:///./src/interceptors.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/cookie-storage.js","webpack:///./src/format-metadata.js","webpack:///./src/expiration-date.js","webpack:///./src/memory-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","value","toString","checkEmpty","key","Error","setProperty","obj","descriptor","writable","tryParse","parsed","JSON","parse","e","isAvailable","localStorage","cookieStorage","sessionStorage","memoryStorage","isStorageAvailable","storageType","storageObj","_webStorage","proxy","data","setItem","removeItem","storageAvailable","_isAvailable","webStorageSettings","default","configStorage","set","WebStorage","undefined","_webStorage2","storage","__storage__","keys","some","_classCallCheck","instance","Constructor","TypeError","copyKeys","forEach","_utils","fallback","msg","console","warn","_createClass","defineProperties","target","props","length","protoProps","staticProps","_interceptors","_interceptors2","_proxyMechanism","INSTANCES","BANNED_KEYS","cachedInstance","options","test","v","stringify","getItem","_this","clear","command","action","INTERCEPTORS","push","executeInterceptors","_len","arguments","args","Array","_key","shift","_typeof","reduce","val","transformed","concat","Symbol","iterator","constructor","_interopRequireDefault","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","window","findCookie","cookie","nameEQ","trim","indexOf","api","assign","path","$cookie","metadata","expires","Date","_expirationDate2","domain","secure","encodeURIComponent","_formatMetadata2","split","find","substring","decodeURIComponent","days","indexEQ","initialize","prop","index","_formatMetadata","_expirationDate","document","buildMetadataFor","formatMetadata","alterDate","opt","date","minutes","setMinutes","getMinutes","hours","setHours","getHours","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","buildExpiration","toUTCString","getStoreFromWindow","store","self","setStoreToWindow","hashtable"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC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qD,KAAKrK,KAAOoK,EAYN,QAASjI,KACtB,GAAMoI,GAAYJ,GAwBlB,OAAO3B,IArBL9F,QAFU,SAEFtB,EAAKH,GACXsJ,EAAUnJ,GAAOH,EACjBqJ,EAAiBC,IAGnBlF,QAPU,SAOFjE,GACN,GAAMH,GAAQsJ,EAAUnJ,EACxB,YAAiB+B,KAAVlC,EAAsB,KAAOA,GAGtC0B,WAZU,SAYCvB,SACFmJ,GAAUnJ,GACjBkJ,EAAiBC,IAGnBhF,MAjBU,WAkBRpF,OAAOoD,KAAKgH,GAAWzG,QAAQ,SAAA1C,GAAA,aAAcmJ,GAAUnJ,KACvDkJ,EAAiBC,KAIEA,GAYzB,QAAS/B,GAAWlB,EAAKiD,GAEvB,IAAK,GAAI9B,KAAQnB,IACf,EAAAvD,EAAAzC,aAAYgG,EAAKmB,EAInB,OADAtI,QAAOoH,OAAOD,EAAKiD,GACZjD,EX6zBTnH,OAAOC,eAAenB,EAAS,cAC7BgC,OAAO,GAGT,IAAIkF,GAA4B,kBAAXK,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUlF,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXiF,SAAyBjF,EAAImF,cAAgBF,QAAUjF,IAAQiF,OAAO5F,UAAY,eAAkBW,GAEtQtC,GAAQ8D,QW/2BgBZ,CA1CxB,IAAA4B,GAAAxE,EAAA","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.checkEmpty = checkEmpty;\nexports.setProperty = setProperty;\nexports.tryParse = tryParse;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true // fallback storage\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(3);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _interceptors = __webpack_require__(4);\n\nvar _interceptors2 = _interopRequireDefault(_interceptors);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nvar _proxyMechanism = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nvar BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = (0, _utils.tryParse)(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n var fallback = storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n var msg = storageType + ' is not available. Falling back to ' + fallback;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n var v = (0, _interceptors2.default)('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n _proxyMechanism.proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n // null or undefined\n delete this[key];\n value = null;\n } else {\n value = (0, _utils.tryParse)(value);\n this[key] = value;\n }\n var v = (0, _interceptors2.default)('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key, options) {\n (0, _utils.checkEmpty)(key);\n (0, _interceptors2.default)('removeItem', key, options);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n (0, _interceptors2.default)('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors.INTERCEPTORS && typeof action === 'function') {\n _interceptors.INTERCEPTORS[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n/**\n * @public API\n */\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = executeInterceptors;\n/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar INTERCEPTORS = exports.INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(6);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(9);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: (0, _cookieStorage2.default)(),\n memoryStorage: (0, _memoryStorage2.default)()\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _utils = __webpack_require__(0);\n\nvar _formatMetadata = __webpack_require__(7);\n\nvar _formatMetadata2 = _interopRequireDefault(_formatMetadata);\n\nvar _expirationDate = __webpack_require__(8);\n\nvar _expirationDate2 = _interopRequireDefault(_expirationDate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = (0, _expirationDate2.default)(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n var cookie = key + '=' + encodeURIComponent(value) + (0, _formatMetadata2.default)(metadata);\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem: function removeItem(key, options) {\n var metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0;\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n }\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexports.default = cookieStorage;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = formatMetadata;\n/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return ';' + key + '=' + data[key];\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction formatMetadata(data) {\n var expires = buildMetadataFor('expires', data);\n var domain = buildMetadataFor('domain', data);\n var path = buildMetadataFor('path', data);\n var secure = data.secure ? ';secure' : '';\n return '' + expires + domain + path + secure;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildExpiration;\n/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpiration(date) {\n var expires = date instanceof Date ? alterDate({ date: date }) : alterDate(date);\n return expires.toUTCString();\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = memoryStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n var store = void 0;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n }\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fd32f1307368e64ca7b0","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nexport function tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js","import executeInterceptors, {INTERCEPTORS} from './interceptors';\nimport {setProperty, checkEmpty, tryParse} from './utils';\nimport {isAvailable} from './is-available';\nimport {proxy} from './proxy-mechanism';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nconst BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n const fallback =\n storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n const msg = `${storageType} is not available. Falling back to ${fallback}`;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) { // null or undefined\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key, options) {\n checkEmpty(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in INTERCEPTORS && typeof action === 'function') {\n INTERCEPTORS[command].push(action);\n }\n }\n}\n\n/**\n * @public API\n */\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nexport const INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nexport default function executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/interceptors.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: cookieStorage(),\n memoryStorage: memoryStorage(),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","import {isObject, setProperty} from './utils';\nimport formatMetadata from './format-metadata';\nimport buildExpiration from './expiration-date';\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n const api = {\n\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpiration(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n const cookie = `${key}=${encodeURIComponent(value)}${formatMetadata(metadata)}`;\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem(key, options) {\n const metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ;\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexport default cookieStorage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return `;${key}=${data[key]}`;\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nexport default function formatMetadata(data) {\n const expires = buildMetadataFor('expires', data);\n const domain = buildMetadataFor('domain', data);\n const path = buildMetadataFor('path', data);\n const secure = data.secure ? ';secure' : '';\n return `${expires}${domain}${path}${secure}`;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/format-metadata.js","/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nexport default function buildExpiration(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date));\n return expires.toUTCString();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/expiration-date.js","import {setProperty} from './utils';\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n let store;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && typeof store === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap dbbc7ae164219c6cf697","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/proxy-storage.js","webpack:///./src/web-storage.js","webpack:///./src/interceptors.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/cookie-storage.js","webpack:///./src/format-metadata.js","webpack:///./src/expiration-date.js","webpack:///./src/memory-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","value","toString","checkEmpty","key","Error","setProperty","obj","descriptor","writable","tryParse","parsed","JSON","parse","e","isAvailable","localStorage","cookieStorage","sessionStorage","memoryStorage","isStorageAvailable","storageType","storageObj","_webStorage","proxy","data","setItem","removeItem","storageAvailable","_isAvailable","webStorageSettings","default","configStorage","set","WebStorage","undefined","_webStorage2","storage","__storage__","keys","some","_classCallCheck","instance","Constructor","TypeError","copyKeys","forEach","_utils","fallback","msg","console","warn","_createClass","defineProperties","target","props","length","protoProps","staticProps","_interceptors","_interceptors2","_proxyMechanism","INSTANCES","BANNED_KEYS","cachedInstance","options","test","v","stringify","getItem","noParse","_this","clear","command","action","INTERCEPTORS","push","executeInterceptors","_len","arguments","args","Array","_key","shift","_typeof","reduce","val","transformed","concat","Symbol","iterator","constructor","_interopRequireDefault","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","window","findCookie","cookie","nameEQ","trim","indexOf","api","assign","path","$cookie","metadata","expires","Date","_expirationDate2","domain","secure","encodeURIComponent","_formatMetadata2","split","find","substring","decodeURIComponent","days","indexEQ","initialize","prop","index","_formatMetadata","_expirationDate","document","buildMetadataFor","formatMetadata","alterDate","opt","date","minutes","setMinutes","getMinutes","hours","setHours","getHours","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","buildExpiration","toUTCString","getStoreFromWindow","store","self","setStoreToWindow","hashtable"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAA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OqD,KAAKtK,KAAOqK,EAYN,QAASlI,KACtB,GAAMqI,GAAYJ,GAwBlB,OAAO3B,IArBL/F,QAFU,SAEFtB,EAAKH,GACXuJ,EAAUpJ,GAAOH,EACjBsJ,EAAiBC,IAGnBnF,QAPU,SAOFjE,GACN,GAAMH,GAAQuJ,EAAUpJ,EACxB,YAAiB+B,KAAVlC,EAAsB,KAAOA,GAGtC0B,WAZU,SAYCvB,SACFoJ,GAAUpJ,GACjBmJ,EAAiBC,IAGnBhF,MAjBU,WAkBRrF,OAAOoD,KAAKiH,GAAW1G,QAAQ,SAAA1C,GAAA,aAAcoJ,GAAUpJ,KACvDmJ,EAAiBC,KAIEA,GAYzB,QAAS/B,GAAWlB,EAAKiD,GAEvB,IAAK,GAAI9B,KAAQnB,IACf,EAAAxD,EAAAzC,aAAYiG,EAAKmB,EAInB,OADAvI,QAAOqH,OAAOD,EAAKiD,GACZjD,EX8zBTpH,OAAOC,eAAenB,EAAS,cAC7BgC,OAAO,GAGT,IAAImF,GAA4B,kBAAXK,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUnF,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXkF,SAAyBlF,EAAIoF,cAAgBF,QAAUlF,IAAQkF,OAAO7F,UAAY,eAAkBW,GAEtQtC,GAAQ8D,QWh3BgBZ,CA1CxB,IAAA4B,GAAAxE,EAAA","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.checkEmpty = checkEmpty;\nexports.setProperty = setProperty;\nexports.tryParse = tryParse;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true // fallback storage\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(3);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _interceptors = __webpack_require__(4);\n\nvar _interceptors2 = _interopRequireDefault(_interceptors);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nvar _proxyMechanism = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nvar BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = (0, _utils.tryParse)(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n var fallback = storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n var msg = storageType + ' is not available. Falling back to ' + fallback;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n var v = (0, _interceptors2.default)('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n _proxyMechanism.proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @param {boolean} noParse: if the value shoudn't be parsed with `JSON.parse`\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key, noParse) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n // null or undefined\n delete this[key];\n value = null;\n } else {\n if (noParse !== true) value = (0, _utils.tryParse)(value);\n this[key] = value;\n }\n var v = (0, _interceptors2.default)('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key, options) {\n (0, _utils.checkEmpty)(key);\n (0, _interceptors2.default)('removeItem', key, options);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n (0, _interceptors2.default)('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors.INTERCEPTORS && typeof action === 'function') {\n _interceptors.INTERCEPTORS[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n/**\n * @public API\n */\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = executeInterceptors;\n/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar INTERCEPTORS = exports.INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(6);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(9);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: (0, _cookieStorage2.default)(),\n memoryStorage: (0, _memoryStorage2.default)()\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _utils = __webpack_require__(0);\n\nvar _formatMetadata = __webpack_require__(7);\n\nvar _formatMetadata2 = _interopRequireDefault(_formatMetadata);\n\nvar _expirationDate = __webpack_require__(8);\n\nvar _expirationDate2 = _interopRequireDefault(_expirationDate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = (0, _expirationDate2.default)(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n var cookie = key + '=' + encodeURIComponent(value) + (0, _formatMetadata2.default)(metadata);\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem: function removeItem(key, options) {\n var metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0;\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n }\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexports.default = cookieStorage;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = formatMetadata;\n/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return ';' + key + '=' + data[key];\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction formatMetadata(data) {\n var expires = buildMetadataFor('expires', data);\n var domain = buildMetadataFor('domain', data);\n var path = buildMetadataFor('path', data);\n var secure = data.secure ? ';secure' : '';\n return '' + expires + domain + path + secure;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildExpiration;\n/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpiration(date) {\n var expires = date instanceof Date ? alterDate({ date: date }) : alterDate(date);\n return expires.toUTCString();\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = memoryStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n var store = void 0;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n }\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (var prop in api) {\n // eslint-disable-line\n (0, _utils.setProperty)(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap dbbc7ae164219c6cf697","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Try to parse a value from JSON.\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nexport function tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n cookieStorage: false,\n sessionStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n } catch (e) {\n return false;\n }\n return true;\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n/**\n * @public API\n */\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js","import executeInterceptors, {INTERCEPTORS} from './interceptors';\nimport {setProperty, checkEmpty, tryParse} from './utils';\nimport {isAvailable} from './is-available';\nimport {proxy} from './proxy-mechanism';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst INSTANCES = {};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nconst BANNED_KEYS = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Copies all existing keys in the storage.\n *\n * @param {CookieStorage} instance: the object to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {object}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n return instance;\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n const fallback =\n storageType === 'sessionStorage' ? 'memoryStorage' : webStorageSettings.default;\n const msg = `${storageType} is not available. Falling back to ${fallback}`;\n console.warn(msg); // eslint-disable-line\n return fallback;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = INSTANCES[storageType];\n if (cachedInstance) {\n return copyKeys(cachedInstance, storage);\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n INSTANCES[storageType] = copyKeys(this, storage);\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const storageType = this.__storage__;\n if (storageType === 'cookieStorage' && BANNED_KEYS.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @param {boolean} noParse: if the value shoudn't be parsed with `JSON.parse`\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key, noParse) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) { // null or undefined\n delete this[key];\n value = null;\n } else {\n if (noParse !== true) value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key, options) {\n checkEmpty(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in INTERCEPTORS && typeof action === 'function') {\n INTERCEPTORS[command].push(action);\n }\n }\n}\n\n/**\n * @public API\n */\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/**\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nexport const INTERCEPTORS = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * Executes the interceptors for a WebStorage method and allows\n * the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nexport default function executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return INTERCEPTORS[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/interceptors.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\n\n/**\n * @public\n *\n * Proxy for the storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: cookieStorage(),\n memoryStorage: memoryStorage(),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","import {isObject, setProperty} from './utils';\nimport formatMetadata from './format-metadata';\nimport buildExpiration from './expiration-date';\n\n/**\n * @private\n *\n * Proxy for document.cookie\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document.cookie,\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n const api = {\n\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpiration(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n if (options.secure === true) metadata.secure = true;\n const cookie = `${key}=${encodeURIComponent(value)}${formatMetadata(metadata)}`;\n // TODO: should encodeURIComponent(key) ?\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n // TODO: Add the method getAll() to get all cookies\n // https://github.com/jherax/proxy-storage/issues/6\n\n removeItem(key, options) {\n const metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ;\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n };\n\n return initialize(api);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initialize(api) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n if (key) api[key] = decodeURIComponent(value);\n });\n return api;\n}\n\n/**\n * @public API\n */\nexport default cookieStorage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Builds the string for the cookie metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return `;${key}=${data[key]}`;\n}\n\n/**\n * Builds the whole string for the cookie metadata.\n *\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nexport default function formatMetadata(data) {\n const expires = buildMetadataFor('expires', data);\n const domain = buildMetadataFor('domain', data);\n const path = buildMetadataFor('path', data);\n const secure = data.secure ? ';secure' : '';\n return `${expires}${domain}${path}${secure}`;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/format-metadata.js","/**\n * @private\n *\n * Adds or subtracts date portions to the given date and returns the new date.\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Builds the expiration for the cookie.\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nexport default function buildExpiration(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date));\n return expires.toUTCString();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/expiration-date.js","import {setProperty} from './utils';\n\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n let store;\n try {\n store = JSON.parse(window.self.name);\n } catch (e) {\n return {};\n }\n if (store && typeof store === 'object') return store;\n return {};\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory, and implements\n * the Web Storage interface. It also adds a hack to persist\n * the storage in the session for the current tab (browser).\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n };\n\n return initialize(api, hashtable);\n}\n\n/**\n * @private\n *\n * Copy the current items in the cookie storage.\n *\n * @param {object} api: the storage mechanism to initialize\n * @param {object} hashtable: store from the window tab\n * @return {object}\n */\nfunction initialize(api, hashtable) {\n // sets API members to read-only and non-enumerable\n for (let prop in api) { // eslint-disable-line\n setProperty(api, prop);\n }\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 51442ef..28f3858 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "proxy-storage", - "version": "2.3.1", + "version": "2.3.2", "description": "Normalizes the API for cookies, and localStorage/sessionStorage", "author": "David Rivera ", "main": "src/proxy-storage.js", diff --git a/src/web-storage.js b/src/web-storage.js index f7fa90b..9b3f619 100644 --- a/src/web-storage.js +++ b/src/web-storage.js @@ -135,18 +135,19 @@ class WebStorage { * Retrieves a value by its key name. * * @param {string} key: keyname of the storage + * @param {boolean} noParse: if the value shoudn't be parsed with `JSON.parse` * @return {void} * * @memberOf WebStorage */ - getItem(key) { + getItem(key, noParse) { checkEmpty(key); let value = proxy[this.__storage__].getItem(key); if (value == null) { // null or undefined delete this[key]; value = null; } else { - value = tryParse(value); + if (noParse !== true) value = tryParse(value); this[key] = value; } const v = executeInterceptors('getItem', key, value); diff --git a/yarn.lock b/yarn.lock index ad88c8a..62fb6b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1211,6 +1211,12 @@ debug@^2.2.0, debug@^2.6.8: dependencies: ms "2.0.0" +debug@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64" + dependencies: + ms "2.0.0" + debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" @@ -1453,18 +1459,18 @@ eslint-scope@^3.7.1: estraverse "^4.1.1" eslint@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.5.0.tgz#bb75d3b8bde97fb5e13efcd539744677feb019c3" + version "4.7.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.7.1.tgz#849804136953ebe366782f9f8611e2cbd1b54681" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" chalk "^2.1.0" concat-stream "^1.6.0" cross-spawn "^5.1.0" - debug "^2.6.8" + debug "^3.0.1" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.5.0" + espree "^3.5.1" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" @@ -1485,7 +1491,7 @@ eslint@^4.5.0: natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^4.0.0" + pluralize "^7.0.0" progress "^2.0.0" require-uncached "^1.0.3" semver "^5.3.0" @@ -1494,9 +1500,9 @@ eslint@^4.5.0: table "^4.0.1" text-table "~0.2.0" -espree@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" +espree@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.1.tgz#0c988b8ab46db53100a1954ae4ba995ddd27d87e" dependencies: acorn "^5.1.1" acorn-jsx "^3.0.0" @@ -2655,9 +2661,9 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" -pluralize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" prelude-ls@~1.1.2: version "1.1.2" @@ -3311,8 +3317,8 @@ webpack-sources@^1.0.1: source-map "~0.5.3" webpack@^3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.5.5.tgz#3226f09fc8b3e435ff781e7af34f82b68b26996c" + version "3.6.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.6.0.tgz#a89a929fbee205d35a4fa2cc487be9cbec8898bc" dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0"