@analytics/session-utils
Advanced tools
Comparing version 0.1.12 to 0.1.13
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.1.13](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-session/compare/@analytics/session-utils@0.1.12...@analytics/session-utils@0.1.13) (2021-12-12) | ||
**Note:** Version bump only for package @analytics/session-utils | ||
## [0.1.12](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-session/compare/@analytics/session-utils@0.1.11...@analytics/session-utils@0.1.12) (2021-10-24) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
var utilSessions=function(e){function n(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],o=15&t;e+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}var t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0,r="undefined";function o(e){return t[e]}function i(e,n){return t[e]=n,n}var s=function(){if(typeof s!==r)return s;s=!0;try{sessionStorage.setItem(r,r),sessionStorage.removeItem(r)}catch(e){s=!1}return s}();function a(e){return s?sessionStorage.getItem(e)||void 0:o(e)}function u(e,n){return s?sessionStorage.setItem(e,n):i(e,n)}var c=function(){if(typeof c!==r)return c;try{l("__x","__x"),c=-1!==document.cookie.indexOf("__x"),d("__x")}catch(e){c=!1}return c}(),x=l,f=l;function d(e){return c?l(e,"",-1):function(e){i(e)}(e)}function l(e,n,t,s,a,u){if(typeof window!==r){var x=arguments.length>1;return c||(x?i(e,n):o(e)),x?document.cookie=e+"="+encodeURIComponent(n)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(s?"; path="+s:"")+(a?"; domain="+a:"")+(u?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var g="__",v="session",m="page",p=["id","createdAt","created"];function S(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function b(){var e=S(),t=e[0],r=e[1];return{id:n(),created:r,createdAt:t}}function _(e,n){for(var t={session:[a,u],page:[o,i]}[e],r=t[0],s=t[1],c=b(),x=!1,f={},d=0;d<p.length;d++){var l=p[d],m=g+e+g+v+g+l,S=r(m);x=n||!S;var _=S&&!n?S:s(m,c[l]),h="created"!==l?_:Number(_);f[l]=h}return y(f,x)}function y(e,n){var t=Date.now();return e.elapsed=t-e.created,e.expires&&(e.remaining=Math.abs(e.expires-t)),e.isNew=n,e}function h(e,n){void 0===e&&(e=30);var t=x("__session"),r=t?JSON.parse(t):w(e);return n?r:y(r,!t)}function w(e,n,t){void 0===e&&(e=30);var r=t?h(e,!0):b(),o=60*e,i=r.created;if(t){var s=S(),a=s[0],u=s[1];r.modified=u,r.modifiedAt=a,i=u}var c=S(i+1e3*o),x=c[0];return r.expires=c[1],r.expiresAt=x,n&&(r=Object.assign(r,n)),f("__session",JSON.stringify(r),o),y(r,!t)}var I=_.bind(null,v),D=_.bind(null,v,!0),O=_.bind(null,m),A=_.bind(null,m,!0);return e.extendSession=function(e,n){return void 0===e&&(e=30),w(e||1,n,!0)},e.getPageSession=O,e.getSession=h,e.getTabSession=I,e.removeSession=function(){return d("__session")},e.sessionData=b,e.setPageSession=A,e.setSession=w,e.setTabSession=D,e}({}); | ||
var utilSessions=function(e){function n(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],o=15&t;e+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}var t="undefined",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function o(e){return r[e]}function i(e,n){return r[e]=n,n}var s=function(){if(typeof s!==t)return s;s=!0;try{sessionStorage.setItem(t,t),sessionStorage.removeItem(t)}catch(e){s=!1}return s}();function a(e){return s?sessionStorage.getItem(e)||void 0:o(e)}function u(e,n){return s?sessionStorage.setItem(e,n):i(e,n)}var x=function(){if(typeof x!==t)return x;try{l("__x","__x"),x=-1!==document.cookie.indexOf("__x"),d("__x")}catch(e){x=!1}return x}(),c=l,f=l;function d(e){return x?l(e,"",-1):void i(e)}function l(e,n,r,s,a,u){if(typeof window!==t){var c=arguments.length>1;return x||(c?i(e,n):o(e)),c?document.cookie=e+"="+encodeURIComponent(n)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(s?"; path="+s:"")+(a?"; domain="+a:"")+(u?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var v="__",g="session",m="page",p=["id","createdAt","created"];function S(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function b(){var e=S(),t=e[0],r=e[1];return{id:n(),created:r,createdAt:t}}function _(e,n){for(var t={session:[a,u],page:[o,i]}[e],r=t[0],s=t[1],x=b(),c=!1,f={},d=0;d<p.length;d++){var l=p[d],m=v+e+v+g+v+l,S=r(m);c=n||!S;var _=S&&!n?S:s(m,x[l]),h="created"!==l?_:Number(_);f[l]=h}return y(f,c)}function y(e,n){var t=Date.now();return e.elapsed=t-e.created,e.expires&&(e.remaining=Math.abs(e.expires-t)),e.isNew=n,e}function h(e,n){void 0===e&&(e=30);var t=c("__session"),r=t?JSON.parse(t):w(e);return n?r:y(r,!t)}function w(e,n,t){void 0===e&&(e=30);var r=t?h(e,!0):b(),o=60*e,i=r.created;if(t){var s=S(),a=s[0],u=s[1];r.modified=u,r.modifiedAt=a,i=u}var x=S(i+1e3*o),c=x[0];return r.expires=x[1],r.expiresAt=c,n&&(r=Object.assign(r,n)),f("__session",JSON.stringify(r),o),y(r,!t)}var I=_.bind(null,g),D=_.bind(null,g,!0),O=_.bind(null,m),A=_.bind(null,m,!0);return e.extendSession=function(e,n){return void 0===e&&(e=30),w(e||1,n,!0)},e.getPageSession=O,e.getSession=h,e.getTabSession=I,e.removeSession=function(){return d("__session")},e.sessionData=b,e.setPageSession=A,e.setSession=w,e.setTabSession=D,e}({}); | ||
//# sourceMappingURL=session-utils.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e||self).utilSessions={})}(this,function(e){function n(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],i=15&t;e+="-"==o||"4"==o?o:("x"==o?i:3&i|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}var t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0,o="undefined";function i(e){return t[e]}function r(e,n){return t[e]=n,n}var s=function(){if(typeof s!==o)return s;s=!0;try{sessionStorage.setItem(o,o),sessionStorage.removeItem(o)}catch(e){s=!1}return s}();function a(e){return s?sessionStorage.getItem(e)||void 0:i(e)}function u(e,n){return s?sessionStorage.setItem(e,n):r(e,n)}var f=function(){if(typeof f!==o)return f;try{l("__x","__x"),f=-1!==document.cookie.indexOf("__x"),x("__x")}catch(e){f=!1}return f}(),d=l,c=l;function x(e){return f?l(e,"",-1):function(e){r(e)}(e)}function l(e,n,t,s,a,u){if(typeof window!==o){var d=arguments.length>1;return f||(d?r(e,n):i(e)),d?document.cookie=e+"="+encodeURIComponent(n)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(s?"; path="+s:"")+(a?"; domain="+a:"")+(u?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var g="__",p="session",v="page",m=["id","createdAt","created"];function b(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function S(){var e=b(),t=e[0],o=e[1];return{id:n(),created:o,createdAt:t}}function _(e,n){for(var t={session:[a,u],page:[i,r]}[e],o=t[0],s=t[1],f=S(),d=!1,c={},x=0;x<m.length;x++){var l=m[x],v=g+e+g+p+g+l,b=o(v);d=n||!b;var _=b&&!n?b:s(v,f[l]),h="created"!==l?_:Number(_);c[l]=h}return y(c,d)}function y(e,n){var t=Date.now();return e.elapsed=t-e.created,e.expires&&(e.remaining=Math.abs(e.expires-t)),e.isNew=n,e}function h(e,n){void 0===e&&(e=30);var t=d("__session"),o=t?JSON.parse(t):w(e);return n?o:y(o,!t)}function w(e,n,t){void 0===e&&(e=30);var o=t?h(e,!0):S(),i=60*e,r=o.created;if(t){var s=b(),a=s[0],u=s[1];o.modified=u,o.modifiedAt=a,r=u}var f=b(r+1e3*i),d=f[0];return o.expires=f[1],o.expiresAt=d,n&&(o=Object.assign(o,n)),c("__session",JSON.stringify(o),i),y(o,!t)}var I=_.bind(null,p),D=_.bind(null,p,!0),T=_.bind(null,v),O=_.bind(null,v,!0);e.extendSession=function(e,n){return void 0===e&&(e=30),w(e||1,n,!0)},e.getPageSession=T,e.getSession=h,e.getTabSession=I,e.removeSession=function(){return x("__session")},e.sessionData=S,e.setPageSession=O,e.setSession=w,e.setTabSession=D}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e||self).utilSessions={})}(this,function(e){function n(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],i=15&t;e+="-"==o||"4"==o?o:("x"==o?i:3&i|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}var t="undefined",o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function i(e){return o[e]}function r(e,n){return o[e]=n,n}var s=function(){if(typeof s!==t)return s;s=!0;try{sessionStorage.setItem(t,t),sessionStorage.removeItem(t)}catch(e){s=!1}return s}();function a(e){return s?sessionStorage.getItem(e)||void 0:i(e)}function u(e,n){return s?sessionStorage.setItem(e,n):r(e,n)}var f=function(){if(typeof f!==t)return f;try{l("__x","__x"),f=-1!==document.cookie.indexOf("__x"),c("__x")}catch(e){f=!1}return f}(),d=l,x=l;function c(e){return f?l(e,"",-1):void r(e)}function l(e,n,o,s,a,u){if(typeof window!==t){var d=arguments.length>1;return f||(d?r(e,n):i(e)),d?document.cookie=e+"="+encodeURIComponent(n)+(o?"; expires="+new Date(+new Date+1e3*o).toUTCString()+(s?"; path="+s:"")+(a?"; domain="+a:"")+(u?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var g="__",p="session",v="page",m=["id","createdAt","created"];function b(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function S(){var e=b(),t=e[0],o=e[1];return{id:n(),created:o,createdAt:t}}function _(e,n){for(var t={session:[a,u],page:[i,r]}[e],o=t[0],s=t[1],f=S(),d=!1,x={},c=0;c<m.length;c++){var l=m[c],v=g+e+g+p+g+l,b=o(v);d=n||!b;var _=b&&!n?b:s(v,f[l]),h="created"!==l?_:Number(_);x[l]=h}return y(x,d)}function y(e,n){var t=Date.now();return e.elapsed=t-e.created,e.expires&&(e.remaining=Math.abs(e.expires-t)),e.isNew=n,e}function h(e,n){void 0===e&&(e=30);var t=d("__session"),o=t?JSON.parse(t):w(e);return n?o:y(o,!t)}function w(e,n,t){void 0===e&&(e=30);var o=t?h(e,!0):S(),i=60*e,r=o.created;if(t){var s=b(),a=s[0],u=s[1];o.modified=u,o.modifiedAt=a,r=u}var f=b(r+1e3*i),d=f[0];return o.expires=f[1],o.expiresAt=d,n&&(o=Object.assign(o,n)),x("__session",JSON.stringify(o),i),y(o,!t)}var I=_.bind(null,p),D=_.bind(null,p,!0),T=_.bind(null,v),O=_.bind(null,v,!0);e.extendSession=function(e,n){return void 0===e&&(e=30),w(e||1,n,!0)},e.getPageSession=T,e.getSession=h,e.getTabSession=I,e.removeSession=function(){return c("__session")},e.sessionData=S,e.setPageSession=O,e.setSession=w,e.setTabSession=D}); | ||
//# sourceMappingURL=session-utils.umd.js.map |
{ | ||
"name": "@analytics/session-utils", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"description": "Tiny session utility library", | ||
@@ -53,8 +53,8 @@ "author": "David Wells", | ||
"dependencies": { | ||
"@analytics/cookie-utils": "^0.2.7", | ||
"@analytics/global-storage-utils": "^0.1.2", | ||
"@analytics/session-storage-utils": "^0.0.2", | ||
"analytics-utils": "^1.0.5" | ||
"@analytics/cookie-utils": "^0.2.8", | ||
"@analytics/global-storage-utils": "^0.1.3", | ||
"@analytics/session-storage-utils": "^0.0.3", | ||
"analytics-utils": "^1.0.6" | ||
}, | ||
"gitHead": "22ac7f7b874ec96a434880456b405188a9e31c99" | ||
"gitHead": "23a39489d2d73ad8a6fe36e22596b8ea0067e45e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
359209
6522
+ Added@analytics/session-storage-utils@0.0.3(transitive)
- Removed@analytics/session-storage-utils@0.0.2(transitive)
Updatedanalytics-utils@^1.0.6