Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.4 to 0.4.5

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [0.4.5](https://github.com/DavidWells/analytics/compare/analytics-utils@0.4.4...analytics-utils@0.4.5) (2021-07-20)
**Note:** Version bump only for package analytics-utils
## [0.4.4](https://github.com/DavidWells/analytics/compare/analytics-utils@0.4.3...analytics-utils@0.4.4) (2021-03-20)

@@ -8,0 +16,0 @@

299

dist/analytics-utils.js

@@ -6,57 +6,61 @@ var analyticsUtils = (function (exports) {

function cookie(name, value, ttl, path, domain, secure) {
if (typeof window === 'undefined') return;
/* Set values */
var l = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
if (arguments.length > 1) {
// eslint-disable-next-line no-return-assign
return document.cookie = name + '=' + encodeURIComponent(value) + ( // eslint-disable-next-line operator-linebreak
!ttl ? '' : // Has TTL set expiration on cookie
'; expires=' + new Date(+new Date() + ttl * 1000).toUTCString() + ( // If path set path
!path ? '' : '; path=' + path) + ( // If domain set domain
!domain ? '' : '; domain=' + domain) + ( // If secure set secure
!secure ? '' : '; secure'));
}
function o(o) {
return l[o];
}
return decodeURIComponent((('; ' + document.cookie).split('; ' + name + '=')[1] || '').split(';')[0]);
function e(o, e) {
return l[o] = e, e;
}
function hasCookieSupport() {
try {
var key = '_c_'; // Try to set cookie
function f(l) {
e(l, void 0);
}
cookie(key, '1');
var valueSet = document.cookie.indexOf(key) !== -1; // Cleanup cookie
var r = "undefined",
a = l$1();
cookie(key, '', -1);
return valueSet;
} catch (e) {
return false;
function l$1(t) {
if (void 0 === t && (t = !1), typeof a !== r && !t) return a;
a = !0;
try {
typeof localStorage !== r && typeof JSON !== r || (a = !1), localStorage.setItem("_" + r, "1"), localStorage.removeItem("_" + r);
} catch (t) {
a = !1;
}
return a;
}
/**
* Get a cookie value
* @param {string} name - key of cookie
* @return {string} value of cookie
*/
var n$1 = "undefined",
i = a$1(),
r$1 = d,
c$1 = d;
var getCookie = cookie;
/**
* Set a cookie value
* @param {string} name - key of cookie
* @param {string} value - value of cookie
* @param {string} days - days to keep cookie
*/
function u$1(e$$1) {
return i ? d(e$$1, "", -1) : f(e$$1);
}
var setCookie = cookie;
/**
* Remove a cookie value.
* @param {string} name - key of cookie
*/
function a$1(e$$1) {
if (void 0 === e$$1 && (e$$1 = !1), typeof i !== n$1 && !e$$1) return i;
function removeCookie(name) {
return cookie(name, '', -1);
try {
var o$$1 = "_" + n$1;
d(o$$1, "1"), i = -1 !== document.cookie.indexOf(o$$1), d(o$$1, "", -1);
} catch (e$$1) {
i = !1;
}
return i;
}
function d(t, r, c, u, a, d) {
if (typeof window !== n$1) {
var f$$1 = arguments.length > 1;
return i || (f$$1 ? e(t, r) : o(t)), f$$1 ? document.cookie = t + "=" + encodeURIComponent(r) + (c ? "; expires=" + new Date(+new Date() + 1e3 * c).toUTCString() + (u ? "; path=" + u : "") + (a ? "; domain=" + a : "") + (d ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
}
}
function _typeof(obj) {

@@ -125,20 +129,2 @@ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {

function hasLocalStorage() {
return false;
try {
if (typeof localStorage === 'undefined' || typeof JSON === 'undefined') {
return false;
} // test for safari private
localStorage.setItem('_t_', '1');
localStorage.removeItem('_t_');
} catch (err) {
return false;
}
return true;
}
function parse(input) {

@@ -165,3 +151,3 @@ var value;

}
} catch (e) {
} catch (e$$1) {
value = input;

@@ -173,3 +159,2 @@ }

var globalContext = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' && self.self === self && self || (typeof global === "undefined" ? "undefined" : _typeof(global)) === 'object' && global.global === global && global || undefined;
var ALL = '*';

@@ -180,4 +165,4 @@ var LOCAL_STORAGE = 'localStorage';

var hasStorage = hasLocalStorage();
var hasCookies = hasCookieSupport();
var hasStorage = l$1();
var hasCookiesSupport = a$1();
/**

@@ -193,3 +178,3 @@ * Get storage item from localStorage, cookie, or window

var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!key) return null;
if (!key) return;
var storageType = getStorageType(options); // Get value from all locations

@@ -208,3 +193,3 @@

if (useCookie(storageType)) {
var _value = getCookie(key);
var _value = r$1(key);

@@ -216,3 +201,3 @@ if (_value || storageType === COOKIE) return parse(_value);

return globalContext[key] || null;
return o(key);
}

@@ -222,5 +207,5 @@

return {
cookie: parse(getCookie(key)),
cookie: parse(r$1(key)),
localStorage: parse(localStorage.getItem(key)),
global: globalContext[key] || null
global: o(key)
};

@@ -276,6 +261,6 @@ }

current: value,
previous: parse(getCookie(key)) // Set Cookie
previous: parse(r$1(key)) // Set Cookie
};
setCookie(key, saveValue);
c$1(key, saveValue);

@@ -296,6 +281,6 @@ if (!setAll) {

current: value,
previous: globalContext[key] // Set global value
previous: o(key) // Set global value
};
globalContext[key] = value;
e(key, value);

@@ -322,3 +307,3 @@ if (!setAll) {

var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!key) return false;
if (!key) return;
var storageType = getStorageType(options);

@@ -336,3 +321,3 @@ var removeAll = storageType === ALL;

/* 2. Fallback to cookie */
removeCookie(key);
u$1(key);
locations.push(COOKIE);

@@ -344,3 +329,3 @@ }

if (removeAll || useGlobal(storageType)) {
globalContext[key] = undefined;
f(key);
locations.push(GLOBAL);

@@ -357,3 +342,3 @@ }

function useGlobal(storage) {
return !storage || storage === GLOBAL;
return useType(storage, GLOBAL);
}

@@ -363,3 +348,3 @@

// If has localStorage and storage option not defined, or is set to 'localStorage' or '*'
return hasStorage && (!storage || storage === LOCAL_STORAGE || storage === ALL);
return hasStorage && useType(storage, LOCAL_STORAGE);
}

@@ -369,5 +354,9 @@

// If has cookies and storage option not defined, or is set to 'cookies' or '*'
return hasCookies && (!storage || storage === COOKIE || storage === ALL);
return hasCookiesSupport && useType(storage, COOKIE);
}
function useType(storage, type) {
return !storage || storage === type || storage === ALL;
}
var index = {

@@ -379,69 +368,3 @@ getItem: getItem,

function _typeof$1(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof$1 = function (obj) {
return typeof obj;
};
} else {
_typeof$1 = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof$1(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof$1(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function decode(s) {
function decodeUri(s) {
try {

@@ -547,4 +470,4 @@ return decodeURIComponent(s.replace(/\+/g, ' '));

function getValueParamValue(param, url) {
return decode((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
function paramsGet(param, url) {
return decodeUri((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
}

@@ -588,4 +511,4 @@

while (temp = re.exec(query)) {
var k = decode(temp[1]);
var v = decode(temp[2]);
var k = decodeUri(temp[1]);
var v = decodeUri(temp[2]);

@@ -912,7 +835,73 @@ if (k.substring(k.length - 2) === '[]') {

function _typeof$1(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof$1 = function (obj) {
return typeof obj;
};
} else {
_typeof$1 = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof$1(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof$1(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
exports.storage = index;
exports.getCookie = getCookie;
exports.setCookie = setCookie;
exports.globalContext = globalContext;
exports.removeCookie = removeCookie;
exports.getCookie = r$1;
exports.setCookie = c$1;
exports.globalContext = l;
exports.removeCookie = u$1;
exports.isFunction = isFunction;

@@ -925,3 +914,3 @@ exports.isString = isString;

exports.dotProp = dlv_es;
exports.decodeUri = decode;
exports.decodeUri = decodeUri;
exports.getBrowserLocale = getBrowserLocale;

@@ -934,3 +923,3 @@ exports.getTimeZone = getTimeZone;

exports.paramsClean = paramsClean;
exports.paramsGet = getValueParamValue;
exports.paramsGet = paramsGet;
exports.paramsParse = paramsParse;

@@ -937,0 +926,0 @@ exports.paramsRemove = paramsRemove;

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

var analyticsUtils=function(e){"use strict";function t(e,t,r,n,o,i){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}var f=t,s=t;function a(e){return t(e,"",-1)}function n(e){return(n="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 r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function p(o){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(i,!0).forEach(function(e){var t,r,n;t=o,n=i[r=e],r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):r(i).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})}return o}function m(t){var r;try{void 0===(r=JSON.parse(t))&&(r=t),"true"===r&&(r=!0),"false"===r&&(r=!1),parseFloat(r)===r&&"object"!==n(r)&&(r=parseFloat(r))}catch(e){r=t}return r}var g="object"===("undefined"==typeof self?"undefined":n(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":n(global))&&global.global===global&&global||void 0,d="*",v="localStorage",y="cookie",b="global",o=!1,i=function(){try{t("_c_","1");var e=-1!==document.cookie.indexOf("_c_");return t("_c_","",-1),e}catch(e){return!1}}();function h(e){return"string"==typeof e?e:e.storage}function x(e){return o&&(!e||e===v||e===d)}function O(e){return i&&(!e||e===y||e===d)}var c={getItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;var r,n=h(t);if(n===d)return{cookie:m(f(r=e)),localStorage:m(localStorage.getItem(r)),global:g[r]||null};if(x(n)){var o=localStorage.getItem(e);if(o||n===v)return m(o)}if(O(n)){var i=f(e);if(i||n===y)return m(i)}return g[e]||null},setItem:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(e&&void 0!==t){var n={},o=h(r),i=JSON.stringify(t),a=o===d;if(x(o)){var c={current:t,previous:m(localStorage.getItem(e))};if(localStorage.setItem(e,i),!a)return p({location:v},c);n[v]=c}if(O(o)){var u={current:t,previous:m(f(e))};if(s(e,i),!a)return p({location:y},u);n[y]=u}var l={current:t,previous:g[e]};return g[e]=t,a?(n[b]=l,n):p({location:b},l)}},removeItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var r,n=h(t),o=n===d,i=[];return(o||x(n))&&(localStorage.removeItem(e),i.push(v)),(o||O(n))&&(a(e),i.push(y)),!o&&(r=n)&&r!==b||(g[e]=void 0,i.push(b)),i}};function u(e){return(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})(e)}function l(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}var w="undefined"!=typeof document;function S(e){if(!w)return!1;var t=e||document.referrer;if(t){var r=window.document.location.port,n=t.split("/")[2];return r&&(n=n.replace(":".concat(r),"")),n!==window.location.hostname}return!1}function j(e,t){var r=(e.split("?")||[,])[1];if(!r||-1===r.indexOf(t))return e;var n=new RegExp("(\\&|\\?)".concat(t,'([_A-Za-z0-9"+=.\\/\\-@%]+)'),"g"),o="?".concat(r).replace(n,"").replace(/^&/,"?");return e.replace("?".concat(r),o)}function P(e){return function(e){var t,r={},n=/([^&=]+)=?([^&]*)/g;for(;t=n.exec(e);){var o=l(t[1]),i=l(t[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(r[o]||(r[o]=[])).push(i)):r[o]=""===i||i}for(var a in r){var c=a.split("[");1<c.length&&(k(r,c.map(function(e){return e.replace(/[?[\]\\ ]/g,"")}),r[a]),delete r[a])}return r}(function(e){if(e){var t=e.match(/\?(.*)/);return t&&t[1]?t[1].split("#")[0]:""}return w&&window.location.search.substring(1)}(e))}function k(e,t,r){for(var n=t.length-1,o=0;o<n;++o){var i=t[o];i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function I(e){if(!w)return null;var t=document.createElement("a");return t.setAttribute("href",e),t.hostname}function D(e){return(I(e)||"").split(".").slice(-2).join(".")}function E(e){var t=e.split(".");return 1<t.length?t.slice(0,-1).join("."):e}var R={trimTld:E,getDomainBase:D,getDomainHost:I},_="google";var C={"daum.net":"q","eniro.se":"search_word","naver.com":"query","yahoo.com":"p","msn.com":"q","aol.com":"q","ask.com":"q","baidu.com":"wd","yandex.com":"text","rambler.ru":"words",google:"q","bing.com":{p:"q",n:"live"}};return e.storage=c,e.getCookie=f,e.setCookie=s,e.globalContext=g,e.removeCookie=a,e.isFunction=function(e){return"function"==typeof e},e.isString=function(e){return"string"==typeof e},e.isArray=function(e){return Array.isArray(e)},e.isObject=function(e){if("object"!==u(e)||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},e.isUndefined=function(e){return void 0===e},e.isBoolean=function(e){return"boolean"==typeof e},e.dotProp=function(e,t,r,n,o){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:o;return e===o?r:e},e.decodeUri=l,e.getBrowserLocale=function(){if(w){var e=navigator,t=e.language,r=e.languages,n=e.userLanguage;return n||(r&&r.length?r[0]:t)}},e.getTimeZone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}},e.inBrowser=w,e.isExternalReferrer=S,e.isScriptLoaded=function(r){if(!w)return!0;var n=document.getElementsByTagName("script");return!!Object.keys(n).filter(function(e){var t=n[e].src;return"string"==typeof r?-1!==t.indexOf(r):r instanceof RegExp&&t.match(r)}).length},e.noOp=function(){},e.paramsClean=j,e.paramsGet=function(e,t){return l((RegExp("".concat(e,"=(.+?)(&|$)")).exec(t)||[,""])[1])},e.paramsParse=P,e.paramsRemove=function(o,i){return w?new Promise(function(e,t){if(window.history&&window.history.replaceState){var r=window.location.href,n=j(r,o);r!==n&&history.replaceState({},"",n)}return i&&i(),e()}):Promise.resolve()},e.parseReferrer=function(e,t){if(!w)return!1;var r={source:"(direct)",medium:"(none)",campaign:"(not set)"};e&&S(e)&&(r.referrer=e);var n=function(e){if(!e||!w)return!1;var t=D(e),r=document.createElement("a");if(r.href=e,-1<r.hostname.indexOf(_)&&(t=_),C[t]){var n=C[t],o="string"==typeof n?n:n.p,i=new RegExp(o+"=.*?([^&#]*|$)","gi"),a=r.search.match(i);return{source:n.n||E(t),medium:"organic",term:(a?a[0].split("=")[1]:"")||"(not provided)"}}var c=S(e)?"referral":"internal";return{source:r.hostname,medium:c}}(e);n&&Object.keys(n).length&&(r=Object.assign({},r,n));var o=P(t),i=Object.keys(o);if(!i.length)return r;var a=i.reduce(function(e,t){return t.match(/^utm_/)&&(e["".concat(t.replace(/^utm_/,""))]=o[t]),t.match(/^(d|g)clid/)&&(e.source=_,e.medium=o.gclid?"cpc":"cpm",e[t]=o[t]),e},{});return Object.assign({},r,a)},e.url=R,e.uuid=function(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],o=15&r;e+="-"==n||"4"==n?n:("x"==n?o:3&o|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e},e.throttle=function(r,n){var o,i,a,c=null,u=0,l=function(){u=new Date,c=null,a=r.apply(o,i)};return function(){var e=new Date;u||(u=e);var t=n-(e-u);return o=this,i=arguments,t<=0?(clearTimeout(c),c=null,u=e,a=r.apply(o,i)):c||(c=setTimeout(l,t)),a}},e}({});
var analyticsUtils=function(e){"use strict";var r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0;function l(e){return r[e]}function s(e,t){return r[e]=t}function i(e){s(e,void 0)}var t="undefined",n=o();function o(e){if(void 0===e&&(e=!1),typeof n!==t&&!e)return n;n=!0;try{typeof localStorage!==t&&typeof JSON!==t||(n=!1),localStorage.setItem("_"+t,"1"),localStorage.removeItem("_"+t)}catch(e){n=!1}return n}var c="undefined",u=f(),p=g,m=g;function a(e){return u?g(e,"",-1):i(e)}function f(e){if(void 0===e&&(e=!1),typeof u!==c&&!e)return u;try{var t="_"+c;g(t,"1"),u=-1!==document.cookie.indexOf(t),g(t,"",-1)}catch(e){u=!1}return u}function g(e,t,r,n,o,i){if(typeof window!==c){var a=1<arguments.length;return u||(a?s(e,t):l(e)),a?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}function v(e){return(v="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 y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function d(o){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?y(i,!0).forEach(function(e){var t,r,n;t=o,n=i[r=e],r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):y(i).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})}return o}function b(t){var r;try{void 0===(r=JSON.parse(t))&&(r=t),"true"===r&&(r=!0),"false"===r&&(r=!1),parseFloat(r)===r&&"object"!==v(r)&&(r=parseFloat(r))}catch(e){r=t}return r}var h="*",x="localStorage",O="cookie",w="global",S=o(),j=f();function P(e){return"string"==typeof e?e:e.storage}function I(e){return S&&D(e,x)}function k(e){return j&&D(e,O)}function D(e,t){return!e||e===t||e===h}var E={getItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(e){var r,n=P(t);if(n===h)return{cookie:b(p(r=e)),localStorage:b(localStorage.getItem(r)),global:l(r)};if(I(n)){var o=localStorage.getItem(e);if(o||n===x)return b(o)}if(k(n)){var i=p(e);if(i||n===O)return b(i)}return l(e)}},setItem:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(e&&void 0!==t){var n={},o=P(r),i=JSON.stringify(t),a=o===h;if(I(o)){var c={current:t,previous:b(localStorage.getItem(e))};if(localStorage.setItem(e,i),!a)return d({location:x},c);n[x]=c}if(k(o)){var u={current:t,previous:b(p(e))};if(m(e,i),!a)return d({location:O},u);n[O]=u}var f={current:t,previous:l(e)};return s(e,t),a?(n[w]=f,n):d({location:w},f)}},removeItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(e){var r=P(t),n=r===h,o=[];return(n||I(r))&&(localStorage.removeItem(e),o.push(x)),(n||k(r))&&(a(e),o.push(O)),(n||D(r,w))&&(i(e),o.push(w)),o}}};function R(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}var C="undefined"!=typeof document;function q(e){if(!C)return!1;var t=e||document.referrer;if(t){var r=window.document.location.port,n=t.split("/")[2];return r&&(n=n.replace(":".concat(r),"")),n!==window.location.hostname}return!1}function T(e,t){var r=(e.split("?")||[,])[1];if(!r||-1===r.indexOf(t))return e;var n=new RegExp("(\\&|\\?)".concat(t,'([_A-Za-z0-9"+=.\\/\\-@%]+)'),"g"),o="?".concat(r).replace(n,"").replace(/^&/,"?");return e.replace("?".concat(r),o)}function U(e){return function(e){var t,r={},n=/([^&=]+)=?([^&]*)/g;for(;t=n.exec(e);){var o=R(t[1]),i=R(t[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(r[o]||(r[o]=[])).push(i)):r[o]=""===i||i}for(var a in r){var c=a.split("[");1<c.length&&(_(r,c.map(function(e){return e.replace(/[?[\]\\ ]/g,"")}),r[a]),delete r[a])}return r}(function(e){if(e){var t=e.match(/\?(.*)/);return t&&t[1]?t[1].split("#")[0]:""}return C&&window.location.search.substring(1)}(e))}function _(e,t,r){for(var n=t.length-1,o=0;o<n;++o){var i=t[o];i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function A(e){if(!C)return null;var t=document.createElement("a");return t.setAttribute("href",e),t.hostname}function B(e){return(A(e)||"").split(".").slice(-2).join(".")}function F(e){var t=e.split(".");return 1<t.length?t.slice(0,-1).join("."):e}var N={trimTld:F,getDomainBase:B,getDomainHost:A},J="google";var L={"daum.net":"q","eniro.se":"search_word","naver.com":"query","yahoo.com":"p","msn.com":"q","aol.com":"q","ask.com":"q","baidu.com":"wd","yandex.com":"text","rambler.ru":"words",google:"q","bing.com":{p:"q",n:"live"}};function Z(e){return(Z="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)}return e.storage=E,e.getCookie=p,e.setCookie=m,e.globalContext=r,e.removeCookie=a,e.isFunction=function(e){return"function"==typeof e},e.isString=function(e){return"string"==typeof e},e.isArray=function(e){return Array.isArray(e)},e.isObject=function(e){if("object"!==Z(e)||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},e.isUndefined=function(e){return void 0===e},e.isBoolean=function(e){return"boolean"==typeof e},e.dotProp=function(e,t,r,n,o){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:o;return e===o?r:e},e.decodeUri=R,e.getBrowserLocale=function(){if(C){var e=navigator,t=e.language,r=e.languages,n=e.userLanguage;return n||(r&&r.length?r[0]:t)}},e.getTimeZone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}},e.inBrowser=C,e.isExternalReferrer=q,e.isScriptLoaded=function(r){if(!C)return!0;var n=document.getElementsByTagName("script");return!!Object.keys(n).filter(function(e){var t=n[e].src;return"string"==typeof r?-1!==t.indexOf(r):r instanceof RegExp&&t.match(r)}).length},e.noOp=function(){},e.paramsClean=T,e.paramsGet=function(e,t){return R((RegExp("".concat(e,"=(.+?)(&|$)")).exec(t)||[,""])[1])},e.paramsParse=U,e.paramsRemove=function(o,i){return C?new Promise(function(e,t){if(window.history&&window.history.replaceState){var r=window.location.href,n=T(r,o);r!==n&&history.replaceState({},"",n)}return i&&i(),e()}):Promise.resolve()},e.parseReferrer=function(e,t){if(!C)return!1;var r={source:"(direct)",medium:"(none)",campaign:"(not set)"};e&&q(e)&&(r.referrer=e);var n=function(e){if(!e||!C)return!1;var t=B(e),r=document.createElement("a");if(r.href=e,-1<r.hostname.indexOf(J)&&(t=J),L[t]){var n=L[t],o="string"==typeof n?n:n.p,i=new RegExp(o+"=.*?([^&#]*|$)","gi"),a=r.search.match(i);return{source:n.n||F(t),medium:"organic",term:(a?a[0].split("=")[1]:"")||"(not provided)"}}var c=q(e)?"referral":"internal";return{source:r.hostname,medium:c}}(e);n&&Object.keys(n).length&&(r=Object.assign({},r,n));var o=U(t),i=Object.keys(o);if(!i.length)return r;var a=i.reduce(function(e,t){return t.match(/^utm_/)&&(e["".concat(t.replace(/^utm_/,""))]=o[t]),t.match(/^(d|g)clid/)&&(e.source=J,e.medium=o.gclid?"cpc":"cpm",e[t]=o[t]),e},{});return Object.assign({},r,a)},e.url=N,e.uuid=function(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],o=15&r;e+="-"==n||"4"==n?n:("x"==n?o:3&o|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e},e.throttle=function(r,n){var o,i,a,c=null,u=0,f=function(){u=new Date,c=null,a=r.apply(o,i)};return function(){var e=new Date;u||(u=e);var t=n-(e-u);return o=this,i=arguments,t<=0?(clearTimeout(c),c=null,u=e,a=r.apply(o,i)):c||(c=setTimeout(f,t)),a}},e}({});

@@ -11,69 +11,3 @@ 'use strict';

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function decode(s) {
function decodeUri(s) {
try {

@@ -179,4 +113,4 @@ return decodeURIComponent(s.replace(/\+/g, ' '));

function getValueParamValue(param, url) {
return decode((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
function paramsGet(param, url) {
return decodeUri((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
}

@@ -220,4 +154,4 @@

while (temp = re.exec(query)) {
var k = decode(temp[1]);
var v = decode(temp[2]);
var k = decodeUri(temp[1]);
var v = decodeUri(temp[2]);

@@ -544,2 +478,68 @@ if (k.substring(k.length - 2) === '[]') {

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
exports.dotProp = dlv;

@@ -557,3 +557,3 @@ exports.storage = storageUtils__default;

exports.isBoolean = isBoolean;
exports.decodeUri = decode;
exports.decodeUri = decodeUri;
exports.getBrowserLocale = getBrowserLocale;

@@ -566,3 +566,3 @@ exports.getTimeZone = getTimeZone;

exports.paramsClean = paramsClean;
exports.paramsGet = getValueParamValue;
exports.paramsGet = paramsGet;
exports.paramsParse = paramsParse;

@@ -569,0 +569,0 @@ exports.paramsRemove = paramsRemove;

export { default as dotProp } from 'dlv';
export { default as storage, getCookie, setCookie, globalContext, removeCookie } from '@analytics/storage-utils';
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function decode(s) {
function decodeUri(s) {
try {

@@ -171,4 +105,4 @@ return decodeURIComponent(s.replace(/\+/g, ' '));

function getValueParamValue(param, url) {
return decode((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
function paramsGet(param, url) {
return decodeUri((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
}

@@ -212,4 +146,4 @@

while (temp = re.exec(query)) {
var k = decode(temp[1]);
var v = decode(temp[2]);
var k = decodeUri(temp[1]);
var v = decodeUri(temp[2]);

@@ -536,2 +470,68 @@ if (k.substring(k.length - 2) === '[]') {

export { isFunction, isString, isArray, isObject, isUndefined, isBoolean, decode as decodeUri, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, url, uuid, throttle };
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
export { isFunction, isString, isArray, isObject, isUndefined, isBoolean, decodeUri, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, paramsGet, paramsParse, paramsRemove, parseReferrer, url, uuid, throttle };

@@ -11,69 +11,3 @@ 'use strict';

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function decode(s) {
function decodeUri(s) {
try {

@@ -179,4 +113,4 @@ return decodeURIComponent(s.replace(/\+/g, ' '));

function getValueParamValue(param, url) {
return decode((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
function paramsGet(param, url) {
return decodeUri((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
}

@@ -220,4 +154,4 @@

while (temp = re.exec(query)) {
var k = decode(temp[1]);
var v = decode(temp[2]);
var k = decodeUri(temp[1]);
var v = decodeUri(temp[2]);

@@ -544,2 +478,68 @@ if (k.substring(k.length - 2) === '[]') {

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
exports.dotProp = dlv;

@@ -557,3 +557,3 @@ exports.storage = storageUtils__default;

exports.isBoolean = isBoolean;
exports.decodeUri = decode;
exports.decodeUri = decodeUri;
exports.getBrowserLocale = getBrowserLocale;

@@ -566,3 +566,3 @@ exports.getTimeZone = getTimeZone;

exports.paramsClean = paramsClean;
exports.paramsGet = getValueParamValue;
exports.paramsGet = paramsGet;
exports.paramsParse = paramsParse;

@@ -569,0 +569,0 @@ exports.paramsRemove = paramsRemove;

export { default as dotProp } from 'dlv';
export { default as storage, getCookie, setCookie, globalContext, removeCookie } from '@analytics/storage-utils';
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function decode(s) {
function decodeUri(s) {
try {

@@ -171,4 +105,4 @@ return decodeURIComponent(s.replace(/\+/g, ' '));

function getValueParamValue(param, url) {
return decode((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
function paramsGet(param, url) {
return decodeUri((RegExp("".concat(param, "=(.+?)(&|$)")).exec(url) || [, ''])[1]);
}

@@ -212,4 +146,4 @@

while (temp = re.exec(query)) {
var k = decode(temp[1]);
var v = decode(temp[2]);
var k = decodeUri(temp[1]);
var v = decodeUri(temp[2]);

@@ -536,2 +470,68 @@ if (k.substring(k.length - 2) === '[]') {

export { isFunction, isString, isArray, isObject, isUndefined, isBoolean, decode as decodeUri, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, getValueParamValue as paramsGet, paramsParse, paramsRemove, parseReferrer, url, uuid, throttle };
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isFunction(x) {
return typeof x === 'function';
}
/**
* @param x
* @return {x is string}
*/
function isString(x) {
return typeof x === 'string';
}
/**
* @param x
* @return {x is undefined}
*/
function isUndefined(x) {
return typeof x === 'undefined';
}
/**
* @param x
* @return {x is boolean}
*/
function isBoolean(x) {
return typeof x === 'boolean';
}
/**
* @template T
* @param x
* @return {x is Array<T>}
*/
function isArray(x) {
return Array.isArray(x);
}
/**
* @param obj
* @return {obj is Object}
*/
function isObject(obj) {
if (_typeof(obj) !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
export { isFunction, isString, isArray, isObject, isUndefined, isBoolean, decodeUri, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, paramsGet, paramsParse, paramsRemove, parseReferrer, url, uuid, throttle };
{
"name": "analytics-utils",
"version": "0.4.4",
"version": "0.4.5",
"description": "Analytics utility functions used by 'analytics' module",

@@ -29,2 +29,6 @@ "author": "David Wells <hello@davidwells.io>",

},
"repository": {
"type": "git",
"url": "https://github.com/DavidWells/analytics"
},
"keywords": [

@@ -65,3 +69,3 @@ "analytics",

"dependencies": {
"@analytics/storage-utils": "^0.2.5",
"@analytics/storage-utils": "^0.2.6",
"dlv": "^1.1.3"

@@ -72,3 +76,3 @@ },

},
"gitHead": "87394ecd762454a54b515d243b07d9984de81059"
"gitHead": "fc41263499919b5666630f1d76cc0844eae7370e"
}

@@ -10,2 +10,2 @@ /**

*/
export default function decode(s: string): string;
export function decodeUri(s: string): string;

@@ -6,2 +6,2 @@ /**

*/
export default function hasAdblock(): boolean;
export function hasAdblock(): boolean;
/**
* @returns {string | undefined}
*/
export default function getBrowserLocale(): string | undefined;
export function getBrowserLocale(): string | undefined;
/**
* @returns {string | undefined}
*/
export default function getTimeZone(): string | undefined;
export function getTimeZone(): string | undefined;

@@ -1,2 +0,5 @@

declare var _default: boolean;
export default _default;
/**
* In browser context
* @type boolean true if in browser
*/
export const inBrowser: boolean;

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

export { default as decodeUri } from "./decodeUri.js";
export { default as getBrowserLocale } from "./getBrowserLocale.js";
export { default as getTimeZone } from "./getTimeZone.js";
export { default as inBrowser } from "./inBrowser.js";
export { default as isExternalReferrer } from "./isExternalReferrer.js";
export { default as isScriptLoaded } from "./isScriptLoaded.js";
export { default as noOp } from "./noOp.js";
export { default as paramsClean } from "./paramsClean.js";
export { default as paramsGet } from "./paramsGet.js";
export { default as paramsParse } from "./paramsParse.js";
export { default as paramsRemove } from "./paramsRemove.js";
export { default as parseReferrer } from "./parseReferrer.js";
export { default as url } from "./url.js";
export { default as uuid } from "./uuid.js";
export { default as throttle } from "./throttle.js";
import { isFunction } from "./typeCheck";

@@ -22,2 +7,18 @@ import { isString } from "./typeCheck";

import { isBoolean } from "./typeCheck";
export { storage, getCookie, setCookie, globalContext, removeCookie, isFunction, isString, isArray, isObject, isUndefined, isBoolean, dotProp };
import dotProp from "dlv";
import { decodeUri } from "./decodeUri";
import { getBrowserLocale } from "./getBrowserLocale";
import { getTimeZone } from "./getTimeZone";
import { inBrowser } from "./inBrowser";
import { isExternalReferrer } from "./isExternalReferrer";
import { isScriptLoaded } from "./isScriptLoaded";
import { noOp } from "./noOp";
import { paramsClean } from "./paramsClean";
import { paramsGet } from "./paramsGet";
import { paramsParse } from "./paramsParse";
import { paramsRemove } from "./paramsRemove";
import { parseReferrer } from "./parseReferrer";
import url from "./url";
import { uuid } from "./uuid";
import { throttle } from "./throttle";
export { storage, getCookie, setCookie, globalContext, removeCookie, isFunction, isString, isArray, isObject, isUndefined, isBoolean, dotProp, decodeUri, getBrowserLocale, getTimeZone, inBrowser, isExternalReferrer, isScriptLoaded, noOp, paramsClean, paramsGet, paramsParse, paramsRemove, parseReferrer, url, uuid, throttle };

@@ -5,2 +5,2 @@ /**

*/
export default function isExternalReferrer(ref: string | null | undefined): boolean | undefined;
export function isExternalReferrer(ref: string | null | undefined): boolean | undefined;

@@ -6,2 +6,2 @@ /**

*/
export default function isScriptLoaded(script: string | RegExp): boolean;
export function isScriptLoaded(script: string | RegExp): boolean;

@@ -6,2 +6,2 @@ /**

*/
export default function localTime(): string;
export function localTime(): string;

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

export default function noOp(): void;
export function noOp(): void;

@@ -10,3 +10,3 @@ /**

*/
export default function onRouteChange(callback?: RouteChangeHandler): void;
export function onRouteChange(callback?: RouteChangeHandler): void;
export type RouteChangeHandler = (pathName: string) => void;

@@ -7,2 +7,2 @@ /**

*/
export default function paramsClean(url: string, param: string): string;
export function paramsClean(url: string, param: string): string;

@@ -7,2 +7,2 @@ /**

*/
export default function getValueParamValue(param: string, url: string): string;
export function paramsGet(param: string, url: string): string;

@@ -6,2 +6,2 @@ /**

*/
export default function paramsParse(url?: string | undefined): object;
export function paramsParse(url?: string | undefined): object;

@@ -7,2 +7,2 @@ /**

*/
export default function paramsRemove(param: string, callback?: (() => void) | undefined): PromiseLike<void>;
export function paramsRemove(param: string, callback?: (() => void) | undefined): PromiseLike<void>;

@@ -13,3 +13,3 @@ /**

*/
export default function parseReferrer(referrer?: string | undefined, currentUrl?: string | undefined): ReferrerObject;
export function parseReferrer(referrer?: string | undefined, currentUrl?: string | undefined): ReferrerObject;
export type ReferrerObject = {

@@ -16,0 +16,0 @@ campaign: string;

@@ -7,2 +7,2 @@ /**

*/
export default function throttle<F extends Function>(func: F, wait: number): F;
export function throttle<F extends Function>(func: F, wait: number): F;
/**
* @return {string}
*/
export default function uuid(): string;
export function uuid(): string;
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