@analytics/storage-utils
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.16](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage/compare/@analytics/storage-utils@0.2.15...@analytics/storage-utils@0.2.16) (2022-01-02) | ||
**Note:** Version bump only for package @analytics/storage-utils | ||
## [0.2.15](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-storage/compare/@analytics/storage-utils@0.2.14...@analytics/storage-utils@0.2.15) (2021-12-12) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
var utilStorage=function(e){var t="global",o="undefined",n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function r(e){return n[e]}function a(e,t){return n[e]=t,t}function i(e){a(e)}var u="cookie",l=s(),c=d,f=d;function g(e){return l?d(e,"",-1):i(e)}function s(){if(typeof l!==o)return l;try{d("__x","__x"),l=-1!==document.cookie.indexOf("__x"),g("__x")}catch(e){l=!1}return l}function d(e,t,n,i,u,c){if(typeof window!==o){var f=arguments.length>1;return l||(f?a(e,t):r(e)),f?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(i?"; path="+i:"")+(u?"; domain="+u:"")+(c?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var p="localStorage",v=m();function m(){if(typeof v!==o)return v;v=!0;try{typeof localStorage!==o&&typeof JSON!==o||(v=!1),localStorage.setItem(o,o),localStorage.removeItem(o)}catch(e){v=!1}return v}var y="any",S="undefined"!=typeof window;function b(e){return void 0===e}function I(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}"undefined"!=typeof process&&null!=process.versions&&process,"undefined"!=typeof Deno&&Deno,S&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var O=m(),k=s();function C(e,t){if(e){var o=w(t),n=!A(o),a=h(o)?I(localStorage.getItem(e)):void 0;if(n&&!b(a))return a;var i=x(o)?I(c(e)):void 0;if(n&&i)return i;var u=r(e);return n?u:{localStorage:a,cookie:i,global:u}}}function j(e,o,n){if(e&&!b(o)){var i={},l=w(n),g=JSON.stringify(o),s=!A(l);return h(l)&&(i[p]=N(p,o,I(localStorage.getItem(e))),localStorage.setItem(e,g),s)?i[p]:x(l)&&(i[u]=N(u,o,I(c(e))),f(e,g),s)?i[u]:(i[t]=N(t,o,r(e)),a(e,o),s?i[t]:i)}}function _(e,o){if(e){var n=w(o),r=C(e,"*"),a={};return!b(r.localStorage)&&h(n)&&(localStorage.removeItem(e),a[p]=r.localStorage),!b(r.cookie)&&x(n)&&(g(e),a[u]=r.cookie),!b(r.global)&&L(n,t)&&(i(e),a[t]=r.global),a}}function w(e){return e?function(e){return"string"==typeof e}(e)?e:e.storage:y}function h(e){return O&&L(e,p)}function x(e){return k&&L(e,u)}function A(e){return"*"===e||"all"===e}function L(e,t){return e===y||e===t||A(e)}function N(e,t,o){return{location:e,current:t,previous:o}}var D={setItem:j,getItem:C,removeItem:_};return e.ALL="*",e.ANY=y,e.COOKIE=u,e.GLOBAL=t,e.LOCAL_STORAGE=p,e.default=D,e.getCookie=c,e.getItem=C,e.globalContext=n,e.hasCookies=s,e.hasLocalStorage=m,e.removeCookie=g,e.removeItem=_,e.setCookie=f,e.setItem=j,e}({}); | ||
var utilStorage=function(e){var t="global",o="undefined",n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function r(e){return n[e]}function a(e,t){return n[e]=t,t}function i(e){a(e)}var u="cookie",l=s(),f=d,c=d;function g(e){return l?d(e,"",-1):i(e)}function s(){if(typeof l!==o)return l;try{d("__x","__x"),l=-1!==document.cookie.indexOf("__x"),g("__x")}catch(e){l=!1}return l}function d(e,t,n,i,u,f){if(typeof window!==o){var c=arguments.length>1;return l||(c?a(e,t):r(e)),c?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(i?"; path="+i:"")+(u?"; domain="+u:"")+(f?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var v="localStorage",p=m();function m(){if(typeof p!==o)return p;p=!0;try{typeof localStorage!==o&&typeof JSON!==o||(p=!1),localStorage.setItem(o,o),localStorage.removeItem(o)}catch(e){p=!1}return p}var y="any";"undefined"==typeof process||process;var S="undefined"!=typeof window;function b(e){return void 0===e}function I(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(function(e){if(!function(e){return e&&("object"==typeof e||null!==e)}(e))return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}"undefined"!=typeof Deno&&Deno,S&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var O=m(),k=s();function C(e,t){if(e){var o=w(t),n=!A(o),a=h(o)?I(localStorage.getItem(e)):void 0;if(n&&!b(a))return a;var i=x(o)?I(f(e)):void 0;if(n&&i)return i;var u=r(e);return n?u:{localStorage:a,cookie:i,global:u}}}function j(e,o,n){if(e&&!b(o)){var i={},l=w(n),g=JSON.stringify(o),s=!A(l);return h(l)&&(i[v]=N(v,o,I(localStorage.getItem(e))),localStorage.setItem(e,g),s)?i[v]:x(l)&&(i[u]=N(u,o,I(f(e))),c(e,g),s)?i[u]:(i[t]=N(t,o,r(e)),a(e,o),s?i[t]:i)}}function _(e,o){if(e){var n=w(o),r=C(e,"*"),a={};return!b(r.localStorage)&&h(n)&&(localStorage.removeItem(e),a[v]=r.localStorage),!b(r.cookie)&&x(n)&&(g(e),a[u]=r.cookie),!b(r.global)&&L(n,t)&&(i(e),a[t]=r.global),a}}function w(e){return e?function(e){return"string"==typeof e}(e)?e:e.storage:y}function h(e){return O&&L(e,v)}function x(e){return k&&L(e,u)}function A(e){return"*"===e||"all"===e}function L(e,t){return e===y||e===t||A(e)}function N(e,t,o){return{location:e,current:t,previous:o}}var D={setItem:j,getItem:C,removeItem:_};return e.ALL="*",e.ANY=y,e.COOKIE=u,e.GLOBAL=t,e.LOCAL_STORAGE=v,e.default=D,e.getCookie=f,e.getItem=C,e.globalContext=n,e.hasCookies=s,e.hasLocalStorage=m,e.removeCookie=g,e.removeItem=_,e.setCookie=c,e.setItem=j,e}({}); | ||
//# sourceMappingURL=storage-utils.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).utilStorage={})}(this,function(e){var t="global",o="undefined",n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function r(e){return n[e]}function i(e,t){return n[e]=t,t}function a(e){i(e)}var f="cookie",l=g(),u=d,c=d;function s(e){return l?d(e,"",-1):a(e)}function g(){if(typeof l!==o)return l;try{d("__x","__x"),l=-1!==document.cookie.indexOf("__x"),s("__x")}catch(e){l=!1}return l}function d(e,t,n,a,f,u){if(typeof window!==o){var c=arguments.length>1;return l||(c?i(e,t):r(e)),c?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(a?"; path="+a:"")+(f?"; domain="+f:"")+(u?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var p="localStorage",v=m();function m(){if(typeof v!==o)return v;v=!0;try{typeof localStorage!==o&&typeof JSON!==o||(v=!1),localStorage.setItem(o,o),localStorage.removeItem(o)}catch(e){v=!1}return v}var y="any",b="undefined"!=typeof window;function S(e){return void 0===e}function I(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}"undefined"!=typeof process&&null!=process.versions&&process,"undefined"!=typeof Deno&&Deno,b&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var O=m(),k=g();function h(e,t){if(e){var o=C(t),n=!A(o),i=_(o)?I(localStorage.getItem(e)):void 0;if(n&&!S(i))return i;var a=w(o)?I(u(e)):void 0;if(n&&a)return a;var f=r(e);return n?f:{localStorage:i,cookie:a,global:f}}}function j(e,o,n){if(e&&!S(o)){var a={},l=C(n),s=JSON.stringify(o),g=!A(l);return _(l)&&(a[p]=N(p,o,I(localStorage.getItem(e))),localStorage.setItem(e,s),g)?a[p]:w(l)&&(a[f]=N(f,o,I(u(e))),c(e,s),g)?a[f]:(a[t]=N(t,o,r(e)),i(e,o),g?a[t]:a)}}function x(e,o){if(e){var n=C(o),r=h(e,"*"),i={};return!S(r.localStorage)&&_(n)&&(localStorage.removeItem(e),i[p]=r.localStorage),!S(r.cookie)&&w(n)&&(s(e),i[f]=r.cookie),!S(r.global)&&L(n,t)&&(a(e),i[t]=r.global),i}}function C(e){return e?function(e){return"string"==typeof e}(e)?e:e.storage:y}function _(e){return O&&L(e,p)}function w(e){return k&&L(e,f)}function A(e){return"*"===e||"all"===e}function L(e,t){return e===y||e===t||A(e)}function N(e,t,o){return{location:e,current:t,previous:o}}var D={setItem:j,getItem:h,removeItem:x};e.ALL="*",e.ANY=y,e.COOKIE=f,e.GLOBAL=t,e.LOCAL_STORAGE=p,e.default=D,e.getCookie=u,e.getItem=h,e.globalContext=n,e.hasCookies=g,e.hasLocalStorage=m,e.removeCookie=s,e.removeItem=x,e.setCookie=c,e.setItem=j}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).utilStorage={})}(this,function(e){var t="global",o="undefined",n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function r(e){return n[e]}function i(e,t){return n[e]=t,t}function a(e){i(e)}var f="cookie",u=s(),l=d,c=d;function g(e){return u?d(e,"",-1):a(e)}function s(){if(typeof u!==o)return u;try{d("__x","__x"),u=-1!==document.cookie.indexOf("__x"),g("__x")}catch(e){u=!1}return u}function d(e,t,n,a,f,l){if(typeof window!==o){var c=arguments.length>1;return u||(c?i(e,t):r(e)),c?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(a?"; path="+a:"")+(f?"; domain="+f:"")+(l?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var p="localStorage",v=m();function m(){if(typeof v!==o)return v;v=!0;try{typeof localStorage!==o&&typeof JSON!==o||(v=!1),localStorage.setItem(o,o),localStorage.removeItem(o)}catch(e){v=!1}return v}var y="any";"undefined"==typeof process||process;var b="undefined"!=typeof window;function S(e){return void 0===e}function I(e){var t=e;try{if("true"===(t=JSON.parse(e)))return!0;if("false"===t)return!1;if(function(e){if(!function(e){return e&&("object"==typeof e||null!==e)}(e))return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(e){}if(null!==t&&""!==t)return t}"undefined"!=typeof Deno&&Deno,b&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var O=m(),k=s();function h(e,t){if(e){var o=C(t),n=!A(o),i=_(o)?I(localStorage.getItem(e)):void 0;if(n&&!S(i))return i;var a=w(o)?I(l(e)):void 0;if(n&&a)return a;var f=r(e);return n?f:{localStorage:i,cookie:a,global:f}}}function j(e,o,n){if(e&&!S(o)){var a={},u=C(n),g=JSON.stringify(o),s=!A(u);return _(u)&&(a[p]=N(p,o,I(localStorage.getItem(e))),localStorage.setItem(e,g),s)?a[p]:w(u)&&(a[f]=N(f,o,I(l(e))),c(e,g),s)?a[f]:(a[t]=N(t,o,r(e)),i(e,o),s?a[t]:a)}}function x(e,o){if(e){var n=C(o),r=h(e,"*"),i={};return!S(r.localStorage)&&_(n)&&(localStorage.removeItem(e),i[p]=r.localStorage),!S(r.cookie)&&w(n)&&(g(e),i[f]=r.cookie),!S(r.global)&&L(n,t)&&(a(e),i[t]=r.global),i}}function C(e){return e?function(e){return"string"==typeof e}(e)?e:e.storage:y}function _(e){return O&&L(e,p)}function w(e){return k&&L(e,f)}function A(e){return"*"===e||"all"===e}function L(e,t){return e===y||e===t||A(e)}function N(e,t,o){return{location:e,current:t,previous:o}}var D={setItem:j,getItem:h,removeItem:x};e.ALL="*",e.ANY=y,e.COOKIE=f,e.GLOBAL=t,e.LOCAL_STORAGE=p,e.default=D,e.getCookie=l,e.getItem=h,e.globalContext=n,e.hasCookies=s,e.hasLocalStorage=m,e.removeCookie=g,e.removeItem=x,e.setCookie=c,e.setItem=j}); | ||
//# sourceMappingURL=storage-utils.umd.js.map |
{ | ||
"name": "@analytics/storage-utils", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"description": "Storage utility with fallbacks", | ||
@@ -62,5 +62,5 @@ "author": "David Wells", | ||
"@analytics/localstorage-utils": "^0.1.6", | ||
"@analytics/type-utils": "^0.5.1" | ||
"@analytics/type-utils": "^0.5.2" | ||
}, | ||
"gitHead": "23a39489d2d73ad8a6fe36e22596b8ea0067e45e" | ||
"gitHead": "a4209ddf2b3db2311e7660377f1a1931b16103fa" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
423506
Updated@analytics/type-utils@^0.5.2