@analytics/session-utils
Advanced tools
Comparing version 0.1.16 to 0.1.17
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.1.17](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-session/compare/@analytics/session-utils@0.1.16...@analytics/session-utils@0.1.17) (2022-03-18) | ||
**Note:** Version bump only for package @analytics/session-utils | ||
## [0.1.16](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-session/compare/@analytics/session-utils@0.1.15...@analytics/session-utils@0.1.16) (2022-02-05) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
var utilSessions=function(e){var n="undefined",t="object";"undefined"==typeof process||process;var o="undefined"!=typeof window;function r(e,n){return typeof n===e}function i(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],r=15&t;e+="-"==o||"4"==o?o:("x"==o?r:3&r|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),r.bind(null,"function"),r.bind(null,"string"),r.bind(null,"undefined"),r.bind(null,"boolean");var s="__global__",a=typeof self===t&&self.self===self&&self||typeof global===t&&global.global===global&&global||void 0;function u(e){return a[s][e]}function d(e,n){return a[s][e]=n}function f(e){delete a[s][e]}function c(e,n,t){var o;try{if(x(e)){var r=window[e];o=r[n].bind(r)}}catch(e){}return o||t}a[s]||(a[s]={});var l={};function x(e){if(typeof l[e]!==n)return l[e];try{var t=window[e];t.setItem(n,n),t.removeItem(n)}catch(t){return l[e]=!1}return l[e]=!0}x.bind(null,"sessionStorage");var v=c("sessionStorage","getItem",u),g=c("sessionStorage","setItem",d);c("sessionStorage","removeItem",f);var p=function(){if(void 0!==p)return p;var e="cookiecookie";try{w(e,e),p=-1!==document.cookie.indexOf(e),S(e)}catch(e){p=!1}return p}(),b=w,m=w;function S(e){return p?w(e,"",-1):f(e)}function w(e,n,t,o,r,i){if("undefined"!=typeof window){var s=arguments.length>1;return!1===p&&(s?d(e,n):u(e)),s?document.cookie=e+"="+encodeURIComponent(n)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(o?"; path="+o:"")+(r?"; domain="+r:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var y="__",_="session",h="page",D=["id","createdAt","created"];function I(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function A(){var e=I(),n=e[0],t=e[1];return{id:i(),created:t,createdAt:n}}function j(e,n){for(var t={session:[v,g],page:[u,d]}[e],o=t[0],r=t[1],i=A(),s=!1,a={},f=0;f<D.length;f++){var c=D[f],l=y+e+y+_+y+c,x=o(l);s=n||!x;var p=x&&!n?x:r(l,i[c]),b="created"!==c?p:Number(p);a[c]=b}return k(a,s)}function k(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 N(e,n){void 0===e&&(e=30);var t=b("__session"),o=t?JSON.parse(t):O(e);return n?o:k(o,!t)}function O(e,n,t){void 0===e&&(e=30);var o=t?N(e,!0):A(),r=60*e,i=o.created;if(t){var s=I(),a=s[0],u=s[1];o.modified=u,o.modifiedAt=a,i=u}var d=I(i+1e3*r),f=d[0];return o.expires=d[1],o.expiresAt=f,n&&(o=Object.assign(o,n)),m("__session",JSON.stringify(o),r),k(o,!t)}var T=j.bind(null,_),C=j.bind(null,_,!0),M=j.bind(null,h),U=j.bind(null,h,!0);return e.extendSession=function(e,n){return void 0===e&&(e=30),O(e||1,n,!0)},e.getPageSession=M,e.getSession=N,e.getTabSession=T,e.removeSession=function(){return S("__session")},e.sessionData=A,e.setPageSession=U,e.setSession=O,e.setTabSession=C,e}({}); | ||
var utilSessions=function(n){var e;e=function(n,e){n.exports=function(n,e,t,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)n=n?n[e[r]]:o;return n===o?t:n}},e({exports:{}});var t="undefined",r="object";"undefined"==typeof process||process;var o="undefined"!=typeof window;function i(n,e){return e.charAt(0)[n]()+e.slice(1)}"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var u=i.bind(null,"toUpperCase"),s=i.bind(null,"toLowerCase");function a(n,e){void 0===e&&(e=!0);var t=function(n){return d(n)?u("null"):"object"==typeof n?function(n){return f(n.constructor)?n.constructor.name:null}(n):Object.prototype.toString.call(n).slice(8,-1)}(n);return e?s(t):t}function c(n,e){return typeof e===n}var f=c.bind(null,"function"),l=c.bind(null,"string");function d(n){return null===n}function v(n,e){if("object"!=typeof e||d(e))return!1;if(e instanceof n)return!0;var t=a(new n(""));if(function(n){return n instanceof Error||l(n.message)&&n.constructor&&function(n){return"number"===a(n)&&!isNaN(n)}(n.constructor.stackTraceLimit)}(e))for(;e;){if(a(e)===t)return!0;e=Object.getPrototypeOf(e)}return!1}function p(n,e){var t=n instanceof Element||n instanceof HTMLDocument;return t&&e?function(n,e){return void 0===e&&(e=""),n&&n.nodeName===e.toUpperCase()}(n,e):t}function x(n){var e=[].slice.call(arguments,1);return function(){return n.apply(void 0,[].slice.call(arguments).concat(e))}}function g(){for(var n="",e=0,t=4294967295*Math.random()|0;e++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],o=15&t;n+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),t=e%8==0?4294967295*Math.random()|0:t>>4}return n}c.bind(null,"undefined"),c.bind(null,"boolean"),c.bind(null,"symbol"),v.bind(null,TypeError),v.bind(null,SyntaxError),x(p,"form"),x(p,"button"),x(p,"input"),x(p,"select");var b="__global__",m=typeof self===r&&self.self===self&&self||typeof global===r&&global.global===global&&global||void 0;function y(n){return m[b][n]}function S(n,e){return m[b][n]=e}function w(n){delete m[b][n]}function _(n,e,t){var r;try{if(j(n)){var o=window[n];r=o[e].bind(o)}}catch(n){}return r||t}m[b]||(m[b]={});var h={};function j(n){if(typeof h[n]!==t)return h[n];try{var e=window[n];e.setItem(t,t),e.removeItem(t)}catch(e){return h[n]=!1}return h[n]=!0}j.bind(null,"sessionStorage");var D=_("sessionStorage","getItem",y),I=_("sessionStorage","setItem",S);_("sessionStorage","removeItem",w);var N=function(){if(void 0!==N)return N;var n="cookiecookie";try{k(n,n),N=-1!==document.cookie.indexOf(n),T(n)}catch(n){N=!1}return N}(),O=k,A=k;function T(n){return N?k(n,"",-1):w(n)}function k(n,e,t,r,o,i){if("undefined"!=typeof window){var u=arguments.length>1;return!1===N&&(u?S(n,e):y(n)),u?document.cookie=n+"="+encodeURIComponent(e)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+n+"=")[1]||"").split(";")[0])}}var C="__",U="session",E="page",M=["id","createdAt","created"];function L(n){var e=n?new Date(n):new Date;return[e.toISOString(),e.getTime()]}function P(){var n=L(),e=n[0],t=n[1];return{id:g(),created:t,createdAt:e}}function J(n,e){for(var t={session:[D,I],page:[y,S]}[n],r=t[0],o=t[1],i=P(),u=!1,s={},a=0;a<M.length;a++){var c=M[a],f=C+n+C+U+C+c,l=r(f);u=e||!l;var d=l&&!e?l:o(f,i[c]),v="created"!==c?d:Number(d);s[c]=v}return R(s,u)}function R(n,e){var t=Date.now();return n.elapsed=t-n.created,n.expires&&(n.remaining=Math.abs(n.expires-t)),n.isNew=e,n}function H(n,e){void 0===n&&(n=30);var t=O("__session"),r=t?JSON.parse(t):q(n);return e?r:R(r,!t)}function q(n,e,t){void 0===n&&(n=30);var r=t?H(n,!0):P(),o=60*n,i=r.created;if(t){var u=L(),s=u[0],a=u[1];r.modified=a,r.modifiedAt=s,i=a}var c=L(i+1e3*o),f=c[0];return r.expires=c[1],r.expiresAt=f,e&&(r=Object.assign(r,e)),A("__session",JSON.stringify(r),o),R(r,!t)}var z=J.bind(null,U),B=J.bind(null,U,!0),F=J.bind(null,E),G=J.bind(null,E,!0);return n.extendSession=function(n,e){return void 0===n&&(n=30),q(n||1,e,!0)},n.getPageSession=F,n.getSession=H,n.getTabSession=z,n.removeSession=function(){return T("__session")},n.sessionData=P,n.setPageSession=G,n.setSession=q,n.setTabSession=B,n}({}); | ||
//# 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){var n="undefined",t="object";"undefined"==typeof process||process;var o="undefined"!=typeof window;function i(e,n){return typeof n===e}function r(){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}"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),i.bind(null,"function"),i.bind(null,"string"),i.bind(null,"undefined"),i.bind(null,"boolean");var s="__global__",a=typeof self===t&&self.self===self&&self||typeof global===t&&global.global===global&&global||void 0;function d(e){return a[s][e]}function u(e,n){return a[s][e]=n}function f(e){delete a[s][e]}function c(e,n,t){var o;try{if(x(e)){var i=window[e];o=i[n].bind(i)}}catch(e){}return o||t}a[s]||(a[s]={});var l={};function x(e){if(typeof l[e]!==n)return l[e];try{var t=window[e];t.setItem(n,n),t.removeItem(n)}catch(t){return l[e]=!1}return l[e]=!0}x.bind(null,"sessionStorage");var v=c("sessionStorage","getItem",d),g=c("sessionStorage","setItem",u);c("sessionStorage","removeItem",f);var p=function(){if(void 0!==p)return p;var e="cookiecookie";try{y(e,e),p=-1!==document.cookie.indexOf(e),S(e)}catch(e){p=!1}return p}(),b=y,m=y;function S(e){return p?y(e,"",-1):f(e)}function y(e,n,t,o,i,r){if("undefined"!=typeof window){var s=arguments.length>1;return!1===p&&(s?u(e,n):d(e)),s?document.cookie=e+"="+encodeURIComponent(n)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(o?"; path="+o:"")+(i?"; domain="+i:"")+(r?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var w="__",h="session",_="page",D=["id","createdAt","created"];function I(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function j(){var e=I(),n=e[0],t=e[1];return{id:r(),created:t,createdAt:n}}function A(e,n){for(var t={session:[v,g],page:[d,u]}[e],o=t[0],i=t[1],r=j(),s=!1,a={},f=0;f<D.length;f++){var c=D[f],l=w+e+w+h+w+c,x=o(l);s=n||!x;var p=x&&!n?x:i(l,r[c]),b="created"!==c?p:Number(p);a[c]=b}return T(a,s)}function T(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 k(e,n){void 0===e&&(e=30);var t=b("__session"),o=t?JSON.parse(t):N(e);return n?o:T(o,!t)}function N(e,n,t){void 0===e&&(e=30);var o=t?k(e,!0):j(),i=60*e,r=o.created;if(t){var s=I(),a=s[0],d=s[1];o.modified=d,o.modifiedAt=a,r=d}var u=I(r+1e3*i),f=u[0];return o.expires=u[1],o.expiresAt=f,n&&(o=Object.assign(o,n)),m("__session",JSON.stringify(o),i),T(o,!t)}var O=A.bind(null,h),C=A.bind(null,h,!0),M=A.bind(null,_),U=A.bind(null,_,!0);e.extendSession=function(e,n){return void 0===e&&(e=30),N(e||1,n,!0)},e.getPageSession=M,e.getSession=k,e.getTabSession=O,e.removeSession=function(){return S("__session")},e.sessionData=j,e.setPageSession=U,e.setSession=N,e.setTabSession=C}); | ||
!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){var n="undefined",t="object";"undefined"==typeof process||process;var o="undefined"!=typeof window;function r(e,n){return n.charAt(0)[e]()+n.slice(1)}"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var i=r.bind(null,"toUpperCase"),s=r.bind(null,"toLowerCase");function u(e,n){void 0===n&&(n=!0);var t=function(e){return d(e)?i("null"):"object"==typeof e?function(e){return c(e.constructor)?e.constructor.name:null}(e):Object.prototype.toString.call(e).slice(8,-1)}(e);return n?s(t):t}function a(e,n){return typeof n===e}var c=a.bind(null,"function"),f=a.bind(null,"string");function d(e){return null===e}function l(e,n){if("object"!=typeof n||d(n))return!1;if(n instanceof e)return!0;var t=u(new e(""));if(function(e){return e instanceof Error||f(e.message)&&e.constructor&&function(e){return"number"===u(e)&&!isNaN(e)}(e.constructor.stackTraceLimit)}(n))for(;n;){if(u(n)===t)return!0;n=Object.getPrototypeOf(n)}return!1}function p(e,n){var t=e instanceof Element||e instanceof HTMLDocument;return t&&n?function(e,n){return void 0===n&&(n=""),e&&e.nodeName===n.toUpperCase()}(e,n):t}function v(e){var n=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(n))}}function x(){for(var e="",n=0,t=4294967295*Math.random()|0;n++<36;){var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[n-1],r=15&t;e+="-"==o||"4"==o?o:("x"==o?r:3&r|8).toString(16),t=n%8==0?4294967295*Math.random()|0:t>>4}return e}a.bind(null,"undefined"),a.bind(null,"boolean"),a.bind(null,"symbol"),l.bind(null,TypeError),l.bind(null,SyntaxError),v(p,"form"),v(p,"button"),v(p,"input"),v(p,"select");var b="__global__",g=typeof self===t&&self.self===self&&self||typeof global===t&&global.global===global&&global||void 0;function m(e){return g[b][e]}function y(e,n){return g[b][e]=n}function S(e){delete g[b][e]}function w(e,n,t){var o;try{if(_(e)){var r=window[e];o=r[n].bind(r)}}catch(e){}return o||t}g[b]||(g[b]={});var h={};function _(e){if(typeof h[e]!==n)return h[e];try{var t=window[e];t.setItem(n,n),t.removeItem(n)}catch(n){return h[e]=!1}return h[e]=!0}_.bind(null,"sessionStorage");var j=w("sessionStorage","getItem",m),D=w("sessionStorage","setItem",y);w("sessionStorage","removeItem",S);var T=function(){if(void 0!==T)return T;var e="cookiecookie";try{A(e,e),T=-1!==document.cookie.indexOf(e),O(e)}catch(e){T=!1}return T}(),I=A,N=A;function O(e){return T?A(e,"",-1):S(e)}function A(e,n,t,o,r,i){if("undefined"!=typeof window){var s=arguments.length>1;return!1===T&&(s?y(e,n):m(e)),s?document.cookie=e+"="+encodeURIComponent(n)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(o?"; path="+o:"")+(r?"; domain="+r:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var k="__",C="session",U="page",E=["id","createdAt","created"];function M(e){var n=e?new Date(e):new Date;return[n.toISOString(),n.getTime()]}function L(){var e=M(),n=e[0],t=e[1];return{id:x(),created:t,createdAt:n}}function P(e,n){for(var t={session:[j,D],page:[m,y]}[e],o=t[0],r=t[1],i=L(),s=!1,u={},a=0;a<E.length;a++){var c=E[a],f=k+e+k+C+k+c,d=o(f);s=n||!d;var l=d&&!n?d:r(f,i[c]),p="created"!==c?l:Number(l);u[c]=p}return J(u,s)}function J(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 R(e,n){void 0===e&&(e=30);var t=I("__session"),o=t?JSON.parse(t):H(e);return n?o:J(o,!t)}function H(e,n,t){void 0===e&&(e=30);var o=t?R(e,!0):L(),r=60*e,i=o.created;if(t){var s=M(),u=s[0],a=s[1];o.modified=a,o.modifiedAt=u,i=a}var c=M(i+1e3*r),f=c[0];return o.expires=c[1],o.expiresAt=f,n&&(o=Object.assign(o,n)),N("__session",JSON.stringify(o),r),J(o,!t)}var q=P.bind(null,C),z=P.bind(null,C,!0),B=P.bind(null,U),F=P.bind(null,U,!0);e.extendSession=function(e,n){return void 0===e&&(e=30),H(e||1,n,!0)},e.getPageSession=B,e.getSession=R,e.getTabSession=q,e.removeSession=function(){return O("__session")},e.sessionData=L,e.setPageSession=F,e.setSession=H,e.setTabSession=z}); | ||
//# sourceMappingURL=session-utils.umd.js.map |
{ | ||
"name": "@analytics/session-utils", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"description": "Tiny session utility library", | ||
@@ -53,8 +53,8 @@ "author": "David Wells", | ||
"dependencies": { | ||
"@analytics/cookie-utils": "^0.2.9", | ||
"@analytics/global-storage-utils": "^0.1.4", | ||
"@analytics/session-storage-utils": "^0.0.4", | ||
"analytics-utils": "^1.0.9" | ||
"@analytics/cookie-utils": "^0.2.10", | ||
"@analytics/global-storage-utils": "^0.1.5", | ||
"@analytics/session-storage-utils": "^0.0.5", | ||
"analytics-utils": "^1.0.10" | ||
}, | ||
"gitHead": "104d15e3d891b1560459272443e11bf3b926028b" | ||
"gitHead": "911491fffca5df822a6d8eb5b6255e47983e338c" | ||
} |
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
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
105553
21
82
1
+ Added@analytics/session-storage-utils@0.0.5(transitive)
- Removed@analytics/session-storage-utils@0.0.4(transitive)
Updatedanalytics-utils@^1.0.10