New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

analytics-utils

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics-utils - npm Package Compare versions

Comparing version 0.0.22 to 0.1.0

CHANGELOG.md

26

dist/analytics-utils.js

@@ -183,2 +183,27 @@ var analyticsUtils = (function (exports) {

function onRouteChange() {
var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noOp;
if (!inBrowser) return;
var _window = window,
addEventListener = _window.addEventListener,
history = _window.history,
location = _window.location; // Observe native navigation
addEventListener('popstate', function () {
callback(location.pathname);
}); // Observe manual navigation
var methods = ['push', 'replace'];
methods.map(function (type) {
// eslint-disable-line
var state = "".concat(type, "State");
var historyState = history[state];
history[state] = function () {
callback(arguments[2]);
return historyState.apply(history, arguments);
};
});
}
function paramsClean(url, param) {

@@ -762,2 +787,3 @@ var search = (url.split('?') || [,])[1];

exports.isScriptLoaded = isScriptLoaded;
exports.onRouteChange = onRouteChange;
exports.noOp = noOp;

@@ -764,0 +790,0 @@ exports.paramsClean = paramsClean;

2

dist/analytics-utils.min.js

@@ -1,1 +0,1 @@

var analyticsUtils=function(e){"use strict";var u="undefined"!=typeof window;var a=function(){try{if(!u)return!1;var e="cookietest=";document.cookie="".concat(e,"1");var t=-1!==document.cookie.indexOf(e);return document.cookie="".concat(e,"1; expires=Thu, 01-Jan-1970 00:00:01 GMT"),t}catch(e){return!1}}();function l(e,t,n){if(!a)return!1;var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="; expires=".concat(o.toGMTString())}document.cookie="".concat(e,"=").concat(t).concat(r,"; path=/")}function f(e){if(!a)return!1;for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null}function r(e){if(!a)return!1;l(e,"",-1)}var t={getCookie:f,setCookie:l,removeCookie:r};function s(e){return decodeURIComponent(e).replace(/\+/g," ")}function m(e){if(!u)return!1;var t=e||document.referrer;if(t){var n=window.document.location.port,r=t.split("/")[2];return n&&(r=r.replace(":".concat(n),"")),r!==window.location.hostname}return!1}function i(e,t){var n=(e.split("?")||[,])[1];if(!n||-1===n.indexOf(t))return e;var r=new RegExp("(\\&|\\?)".concat(t,'([_A-Za-z0-9"+=.%]+)'),"g"),o="?".concat(n).replace(r,"").replace(/^&/,"?");return e.replace("?".concat(n),o)}function c(e){var t=function(e){if(e){var t=e.match(/\?(.*)/);return t&&t[1]?t[1].split("#")[0]:""}return u&&window.location.search.substring(1)}(e);return t?function(e){var t,n=/([^&=]+)=?([^&]*)/g,r={};for(;t=n.exec(e);){var o=s(t[1]),a=s(t[2]);if("[]"===o.substring(o.length-2))o=o.substring(0,o.length-2),(r[o]||(r[o]=[])).push(a);else{var i=""===a||a;r[o]=i}}for(var c in r){var u=c.split("[");if(1<u.length){var l=[];u.forEach(function(e,t){var n=e.replace(/[?[\]\\ ]/g,"");l.push(n)}),d(r,l,r[c]),delete r[c]}}return r}(t):{}}function d(e,t,n){for(var r=t.length-1,o=0;o<r;++o){var a=t[o];a in e||(e[a]={}),e=e[a]}e[t[r]]=n}function n(e){if(!u)return null;var t=document.createElement("a");return t.setAttribute("href",e),t.hostname}function p(e){return(n(e)||"").split(".").slice(-2).join(".")}function g(e){var t=e.split(".");return 1<t.length?t.slice(0,-1).join("."):e}var o={trimTld:g,getDomainBase:p,getDomainHost:n},v="google";var y={"daum.net":"q","eniro.se":"search_word","naver.com":"query","yahoo.com":"p","msn.com":"q","aol.com":"q","lycos.com":"q","ask.com":"q","cnn.com":"query","about.com":"terms","baidu.com":"wd","yandex.com":"text","seznam.cz":"q","search.com":"q","yam.com":"k","kvasir.no":"q","terra.com":"query","mynet.com":"q","rambler.ru":"words",google:"q","bing.com":{p:"q",n:"live"}};function h(e){return(h="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})(e)}function b(t){var n;try{void 0===(n=JSON.parse(t))&&(n=t),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==h(n)&&(n=parseFloat(n))}catch(e){n=t}return n}var w="undefined"!=typeof self&&self?self:"undefined"!=typeof window&&window?window:"undefined"!=typeof global&&global?global:"undefined"!=typeof globalThis&&globalThis?globalThis:void 0;var x=function(){if(!u)return!1;try{if("undefined"==typeof localStorage||"undefined"==typeof JSON)return!1;localStorage.setItem("_test_","1"),localStorage.removeItem("_test_")}catch(e){return!1}return!0}();function S(e){return"string"==typeof e?e:e.storage}function k(e){return x&&(!e||"localStorage"===e)}function O(e){return a&&(!e||"cookie"===e)}var T={getItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;var n=S(t);if(k(n)){var r=localStorage.getItem(e);if(r||"localStorage"===n)return b(r)}if(O(n)){var o=f(e);if(o||"cookie"===n)return b(o)}return w[e]||null},setItem:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return!1;var r=S(n),o=JSON.stringify(t);if(k(r)){var a=b(localStorage.getItem(e));return localStorage.setItem(e,o),{value:t,oldValue:a,type:"localStorage"}}if(O(r)){var i=b(f(e));return l(e,o),{value:t,oldValue:i,type:"cookie"}}var c=w[e];return{value:w[e]=t,oldValue:c,type:"window"}},removeItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var n=S(t);return k(n)?(localStorage.removeItem(e),null):O(n)?(r(e),null):w[e]=null}};function q(){return 4294967295*Math.random()|0}return e.cookie=t,e.decodeUri=s,e.detectAdBlock=function(){if(!u)return!1;var e=document.createElement("div");e.innerHTML="&nbsp;",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.style="width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;";try{if(document.body.appendChild(e),null!==document.body.getAttribute("abp")||0===e.offsetHeight||0===e.clientHeight)return!0;if("undefined"!=typeof getComputedStyle){var t=window.getComputedStyle(e,null);if(t&&("none"===t.getPropertyValue("display")||"hidden"===t.getPropertyValue("visibility")))return!0}document.body.removeChild(e)}catch(e){}return!1},e.getBrowserLocale=function(){if(!u)return null;var e=navigator,t=e.language,n=e.languages,r=e.userLanguage;return n&&n.length?n[0]:r||t},e.getTimeZone=function(){return"undefined"==typeof Intl||"function"!=typeof Intl.DateTimeFormat||"function"!=typeof Intl.DateTimeFormat().resolvedOptions?null:Intl.DateTimeFormat().resolvedOptions().timeZone},e.inBrowser=u,e.isExternalReferrer=m,e.isScriptLoaded=function(n){if(!u)return!0;var r=document.getElementsByTagName("script");return!!Object.keys(r).filter(function(e){var t=r[e].src;return"string"==typeof n?-1!==t.indexOf(n):n instanceof RegExp&&t.match(n)}).length},e.noOp=function(){},e.paramsClean=i,e.paramsGet=function(e,t){return s((RegExp("".concat(e,"=(.+?)(&|$)")).exec(t)||[,""])[1])},e.paramsParse=c,e.paramsRemove=function(o,a){return u?new Promise(function(e,t){if(window.history&&window.history.replaceState){var n=window.location.href,r=i(n,o);n!==r&&history.replaceState({},"",r)}return a&&a(),e()}):Promise.resolve()},e.parseReferrer=function(e,t){if(!u)return!1;var n={source:"(direct)",medium:"(none)",campaign:"(not set)"};e&&m(e)&&(n.referrer=e);var r=function(e){if(!e||!u)return!1;var t=p(e),n=document.createElement("a");if(n.href=e,-1<n.hostname.indexOf(v)&&(t=v),y[t]){var r=y[t],o="string"==typeof r?r:r.p,a=new RegExp(o+"=.*?([^&#]*|$)","gi"),i=n.search.match(a);return{source:r.n||g(t),medium:"organic",term:(i?i[0].split("=")[1]:"")||"(not provided)"}}var c=m(e)?"referral":"internal";return{source:n.hostname,medium:c}}(e);r&&Object.keys(r).length&&(n=Object.assign({},n,r));var o=c(t),a=Object.keys(o);if(a.length){var i=a.reduce(function(e,t){return t.match(/^utm_/)&&(e["".concat(t.replace(/^utm_/,""))]=o[t]),t.match(/^(d|g)clid/)&&(e.source=v,e.medium=o.gclid?"cpc":"cpm",e[t]=o[t]),e},{});n=Object.assign({},n,i),(o.dclid||o.gclid)&&(n.source=v,n.medium=o.gclid?"cpc":"cpm")}return n},e.storage=T,e.url=o,e.uuid=function(){for(var e,t,n,r,o=[],a=0;a<256;a++)o[a]=(a<16?"0":"")+a.toString(16);return e=q(),t=q(),n=q(),r=q(),"".concat(o[255&e]+o[e>>8&255]+o[e>>16&255]+o[e>>24&255],"-").concat(o[255&t]).concat(o[t>>8&255],"-").concat(o[t>>16&15|64]).concat(o[t>>24&255],"-").concat(o[63&n|128]).concat(o[n>>8&255],"-").concat(o[n>>16&255]).concat(o[n>>24&255]).concat(o[255&r]).concat(o[r>>8&255]).concat(o[r>>16&255]).concat(o[r>>24&255])},e.globalContext=w,e}({});
var analyticsUtils=function(e){"use strict";var u="undefined"!=typeof window;var a=function(){try{if(!u)return!1;var e="cookietest=";document.cookie="".concat(e,"1");var t=-1!==document.cookie.indexOf(e);return document.cookie="".concat(e,"1; expires=Thu, 01-Jan-1970 00:00:01 GMT"),t}catch(e){return!1}}();function l(e,t,n){if(!a)return!1;var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="; expires=".concat(o.toGMTString())}document.cookie="".concat(e,"=").concat(t).concat(r,"; path=/")}function f(e){if(!a)return!1;for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null}function r(e){if(!a)return!1;l(e,"",-1)}var t={getCookie:f,setCookie:l,removeCookie:r};function s(e){return decodeURIComponent(e).replace(/\+/g," ")}function m(e){if(!u)return!1;var t=e||document.referrer;if(t){var n=window.document.location.port,r=t.split("/")[2];return n&&(r=r.replace(":".concat(n),"")),r!==window.location.hostname}return!1}function i(){}function c(e,t){var n=(e.split("?")||[,])[1];if(!n||-1===n.indexOf(t))return e;var r=new RegExp("(\\&|\\?)".concat(t,'([_A-Za-z0-9"+=.%]+)'),"g"),o="?".concat(n).replace(r,"").replace(/^&/,"?");return e.replace("?".concat(n),o)}function d(e){var t=function(e){if(e){var t=e.match(/\?(.*)/);return t&&t[1]?t[1].split("#")[0]:""}return u&&window.location.search.substring(1)}(e);return t?function(e){var t,n=/([^&=]+)=?([^&]*)/g,r={};for(;t=n.exec(e);){var o=s(t[1]),a=s(t[2]);if("[]"===o.substring(o.length-2))o=o.substring(0,o.length-2),(r[o]||(r[o]=[])).push(a);else{var i=""===a||a;r[o]=i}}for(var c in r){var u=c.split("[");if(1<u.length){var l=[];u.forEach(function(e,t){var n=e.replace(/[?[\]\\ ]/g,"");l.push(n)}),p(r,l,r[c]),delete r[c]}}return r}(t):{}}function p(e,t,n){for(var r=t.length-1,o=0;o<r;++o){var a=t[o];a in e||(e[a]={}),e=e[a]}e[t[r]]=n}function n(e){if(!u)return null;var t=document.createElement("a");return t.setAttribute("href",e),t.hostname}function g(e){return(n(e)||"").split(".").slice(-2).join(".")}function v(e){var t=e.split(".");return 1<t.length?t.slice(0,-1).join("."):e}var o={trimTld:v,getDomainBase:g,getDomainHost:n},h="google";var y={"daum.net":"q","eniro.se":"search_word","naver.com":"query","yahoo.com":"p","msn.com":"q","aol.com":"q","lycos.com":"q","ask.com":"q","cnn.com":"query","about.com":"terms","baidu.com":"wd","yandex.com":"text","seznam.cz":"q","search.com":"q","yam.com":"k","kvasir.no":"q","terra.com":"query","mynet.com":"q","rambler.ru":"words",google:"q","bing.com":{p:"q",n:"live"}};function b(e){return(b="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})(e)}function w(t){var n;try{void 0===(n=JSON.parse(t))&&(n=t),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==b(n)&&(n=parseFloat(n))}catch(e){n=t}return n}var x="undefined"!=typeof self&&self?self:"undefined"!=typeof window&&window?window:"undefined"!=typeof global&&global?global:"undefined"!=typeof globalThis&&globalThis?globalThis:void 0;var S=function(){if(!u)return!1;try{if("undefined"==typeof localStorage||"undefined"==typeof JSON)return!1;localStorage.setItem("_test_","1"),localStorage.removeItem("_test_")}catch(e){return!1}return!0}();function k(e){return"string"==typeof e?e:e.storage}function O(e){return S&&(!e||"localStorage"===e)}function T(e){return a&&(!e||"cookie"===e)}var q={getItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;var n=k(t);if(O(n)){var r=localStorage.getItem(e);if(r||"localStorage"===n)return w(r)}if(T(n)){var o=f(e);if(o||"cookie"===n)return w(o)}return x[e]||null},setItem:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return!1;var r=k(n),o=JSON.stringify(t);if(O(r)){var a=w(localStorage.getItem(e));return localStorage.setItem(e,o),{value:t,oldValue:a,type:"localStorage"}}if(T(r)){var i=w(f(e));return l(e,o),{value:t,oldValue:i,type:"cookie"}}var c=x[e];return{value:x[e]=t,oldValue:c,type:"window"}},removeItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var n=k(t);return O(n)?(localStorage.removeItem(e),null):T(n)?(r(e),null):x[e]=null}};function I(){return 4294967295*Math.random()|0}return e.cookie=t,e.decodeUri=s,e.detectAdBlock=function(){if(!u)return!1;var e=document.createElement("div");e.innerHTML="&nbsp;",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.style="width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;";try{if(document.body.appendChild(e),null!==document.body.getAttribute("abp")||0===e.offsetHeight||0===e.clientHeight)return!0;if("undefined"!=typeof getComputedStyle){var t=window.getComputedStyle(e,null);if(t&&("none"===t.getPropertyValue("display")||"hidden"===t.getPropertyValue("visibility")))return!0}document.body.removeChild(e)}catch(e){}return!1},e.getBrowserLocale=function(){if(!u)return null;var e=navigator,t=e.language,n=e.languages,r=e.userLanguage;return n&&n.length?n[0]:r||t},e.getTimeZone=function(){return"undefined"==typeof Intl||"function"!=typeof Intl.DateTimeFormat||"function"!=typeof Intl.DateTimeFormat().resolvedOptions?null:Intl.DateTimeFormat().resolvedOptions().timeZone},e.inBrowser=u,e.isExternalReferrer=m,e.isScriptLoaded=function(n){if(!u)return!0;var r=document.getElementsByTagName("script");return!!Object.keys(r).filter(function(e){var t=r[e].src;return"string"==typeof n?-1!==t.indexOf(n):n instanceof RegExp&&t.match(n)}).length},e.onRouteChange=function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:i;if(u){var e=window,t=e.addEventListener,o=e.history,n=e.location;t("popstate",function(){r(n.pathname)}),["push","replace"].map(function(e){var t="".concat(e,"State"),n=o[t];o[t]=function(){return r(arguments[2]),n.apply(o,arguments)}})}},e.noOp=i,e.paramsClean=c,e.paramsGet=function(e,t){return s((RegExp("".concat(e,"=(.+?)(&|$)")).exec(t)||[,""])[1])},e.paramsParse=d,e.paramsRemove=function(o,a){return u?new Promise(function(e,t){if(window.history&&window.history.replaceState){var n=window.location.href,r=c(n,o);n!==r&&history.replaceState({},"",r)}return a&&a(),e()}):Promise.resolve()},e.parseReferrer=function(e,t){if(!u)return!1;var n={source:"(direct)",medium:"(none)",campaign:"(not set)"};e&&m(e)&&(n.referrer=e);var r=function(e){if(!e||!u)return!1;var t=g(e),n=document.createElement("a");if(n.href=e,-1<n.hostname.indexOf(h)&&(t=h),y[t]){var r=y[t],o="string"==typeof r?r:r.p,a=new RegExp(o+"=.*?([^&#]*|$)","gi"),i=n.search.match(a);return{source:r.n||v(t),medium:"organic",term:(i?i[0].split("=")[1]:"")||"(not provided)"}}var c=m(e)?"referral":"internal";return{source:n.hostname,medium:c}}(e);r&&Object.keys(r).length&&(n=Object.assign({},n,r));var o=d(t),a=Object.keys(o);if(a.length){var i=a.reduce(function(e,t){return t.match(/^utm_/)&&(e["".concat(t.replace(/^utm_/,""))]=o[t]),t.match(/^(d|g)clid/)&&(e.source=h,e.medium=o.gclid?"cpc":"cpm",e[t]=o[t]),e},{});n=Object.assign({},n,i),(o.dclid||o.gclid)&&(n.source=h,n.medium=o.gclid?"cpc":"cpm")}return n},e.storage=q,e.url=o,e.uuid=function(){for(var e,t,n,r,o=[],a=0;a<256;a++)o[a]=(a<16?"0":"")+a.toString(16);return e=I(),t=I(),n=I(),r=I(),"".concat(o[255&e]+o[e>>8&255]+o[e>>16&255]+o[e>>24&255],"-").concat(o[255&t]).concat(o[t>>8&255],"-").concat(o[t>>16&15|64]).concat(o[t>>24&255],"-").concat(o[63&n|128]).concat(o[n>>8&255],"-").concat(o[n>>16&255]).concat(o[n>>24&255]).concat(o[255&r]).concat(o[r>>8&255]).concat(o[r>>16&255]).concat(o[r>>24&255])},e.globalContext=x,e}({});

@@ -184,2 +184,27 @@ 'use strict';

function onRouteChange() {
var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noOp;
if (!inBrowser) return;
var _window = window,
addEventListener = _window.addEventListener,
history = _window.history,
location = _window.location; // Observe native navigation
addEventListener('popstate', function () {
callback(location.pathname);
}); // Observe manual navigation
var methods = ['push', 'replace'];
methods.map(function (type) {
// eslint-disable-line
var state = "".concat(type, "State");
var historyState = history[state];
history[state] = function () {
callback(arguments[2]);
return historyState.apply(history, arguments);
};
});
}
function paramsClean(url, param) {

@@ -763,2 +788,3 @@ var search = (url.split('?') || [,])[1];

exports.isScriptLoaded = isScriptLoaded;
exports.onRouteChange = onRouteChange;
exports.noOp = noOp;

@@ -765,0 +791,0 @@ exports.paramsClean = paramsClean;

@@ -180,2 +180,27 @@ var inBrowser = typeof window !== 'undefined';

function onRouteChange() {
var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noOp;
if (!inBrowser) return;
var _window = window,
addEventListener = _window.addEventListener,
history = _window.history,
location = _window.location; // Observe native navigation
addEventListener('popstate', function () {
callback(location.pathname);
}); // Observe manual navigation
var methods = ['push', 'replace'];
methods.map(function (type) {
// eslint-disable-line
var state = "".concat(type, "State");
var historyState = history[state];
history[state] = function () {
callback(arguments[2]);
return historyState.apply(history, arguments);
};
});
}
function paramsClean(url, param) {

@@ -751,2 +776,2 @@ var search = (url.split('?') || [,])[1];

export { cookie, decode as decodeUri, hasAdblock as detectAdBlock, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, index as storage, url, uuid, globalContext };
export { cookie, decode as decodeUri, hasAdblock as detectAdBlock, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, onRouteChange, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, index as storage, url, uuid, globalContext };

@@ -184,2 +184,27 @@ 'use strict';

function onRouteChange() {
var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noOp;
if (!inBrowser) return;
var _window = window,
addEventListener = _window.addEventListener,
history = _window.history,
location = _window.location; // Observe native navigation
addEventListener('popstate', function () {
callback(location.pathname);
}); // Observe manual navigation
var methods = ['push', 'replace'];
methods.map(function (type) {
// eslint-disable-line
var state = "".concat(type, "State");
var historyState = history[state];
history[state] = function () {
callback(arguments[2]);
return historyState.apply(history, arguments);
};
});
}
function paramsClean(url, param) {

@@ -763,2 +788,3 @@ var search = (url.split('?') || [,])[1];

exports.isScriptLoaded = isScriptLoaded;
exports.onRouteChange = onRouteChange;
exports.noOp = noOp;

@@ -765,0 +791,0 @@ exports.paramsClean = paramsClean;

@@ -180,2 +180,27 @@ var inBrowser = typeof window !== 'undefined';

function onRouteChange() {
var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noOp;
if (!inBrowser) return;
var _window = window,
addEventListener = _window.addEventListener,
history = _window.history,
location = _window.location; // Observe native navigation
addEventListener('popstate', function () {
callback(location.pathname);
}); // Observe manual navigation
var methods = ['push', 'replace'];
methods.map(function (type) {
// eslint-disable-line
var state = "".concat(type, "State");
var historyState = history[state];
history[state] = function () {
callback(arguments[2]);
return historyState.apply(history, arguments);
};
});
}
function paramsClean(url, param) {

@@ -751,2 +776,2 @@ var search = (url.split('?') || [,])[1];

export { cookie, decode as decodeUri, hasAdblock as detectAdBlock, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, index as storage, url, uuid, globalContext };
export { cookie, decode as decodeUri, hasAdblock as detectAdBlock, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, onRouteChange, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, index as storage, url, uuid, globalContext };
{
"name": "analytics-utils",
"version": "0.0.22",
"description": "Analytics utility functions",
"version": "0.1.0",
"description": "Analytics utility functions used by 'analytics' module",
"author": "David Wells <hello@davidwells.io>",

@@ -29,3 +29,5 @@ "license": "MIT",

"keywords": [
"analytics"
"analytics",
"analytics-project",
"analytics-utilities"
],

@@ -58,3 +60,3 @@ "files": [

},
"gitHead": "706ced454c0d0cf37ed899f4b30d13243622dfe7"
"gitHead": "0104ab8c1ba4b05bbfb8e41abda9e60b901d2664"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc