analytics-utils
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.4.4](https://github.com/DavidWells/analytics/compare/analytics-utils@0.4.3...analytics-utils@0.4.4) (2021-03-20) | ||
**Note:** Version bump only for package analytics-utils | ||
## [0.4.3](https://github.com/DavidWells/analytics/compare/analytics-utils@0.4.2...analytics-utils@0.4.3) (2021-03-11) | ||
@@ -8,0 +16,0 @@ |
@@ -379,14 +379,40 @@ var analyticsUtils = (function (exports) { | ||
} | ||
/** | ||
* @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) { | ||
@@ -413,2 +439,6 @@ if (_typeof$1(obj) !== 'object' || obj === null) return false; | ||
/** | ||
* @returns {string | undefined} | ||
*/ | ||
function getBrowserLocale() { | ||
@@ -431,2 +461,7 @@ if (!inBrowser) return; | ||
/** | ||
* @param {string | null | undefined} ref | ||
* @returns {boolean | undefined} | ||
*/ | ||
function isExternalReferrer(ref) { | ||
@@ -600,4 +635,4 @@ if (!inBrowser) return false; | ||
* @param {string} param - param key to remove from current URL | ||
* @param {function} [callback] - callback function to run. Only runs in browser | ||
* @return {promise} | ||
* @param {() => void} [callback] - callback function to run. Only runs in browser | ||
* @return {PromiseLike<void>} | ||
*/ | ||
@@ -675,6 +710,13 @@ | ||
/** | ||
* @typedef {{ | ||
* campaign: string, | ||
* referrer?: string, | ||
* } & DomainObject & Object.<string, any>} ReferrerObject | ||
*/ | ||
/** | ||
* Checks a given url and parses referrer data | ||
* @param {String} [referrer] - (optional) referring URL | ||
* @param {String} [currentUrl] - (optional) the current url | ||
* @return {Object} [description] | ||
* @return {ReferrerObject} [description] | ||
*/ | ||
@@ -731,5 +773,13 @@ | ||
/** | ||
* @typedef {{ | ||
* source: string, | ||
* medium: string, | ||
* term?: string | ||
* }} DomainObject | ||
*/ | ||
/** | ||
* Client side domain parser for determining marketing data. | ||
* @param {String} referrer - ref url | ||
* @return {Object} | ||
* @return {DomainObject | boolean} | ||
*/ | ||
@@ -793,2 +843,5 @@ | ||
/** | ||
* @return {string} | ||
*/ | ||
function uuid() { | ||
@@ -795,0 +848,0 @@ var u = '', |
@@ -28,14 +28,40 @@ 'use strict'; | ||
} | ||
/** | ||
* @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) { | ||
@@ -62,2 +88,6 @@ if (_typeof(obj) !== 'object' || obj === null) return false; | ||
/** | ||
* @returns {string | undefined} | ||
*/ | ||
function getBrowserLocale() { | ||
@@ -80,2 +110,7 @@ if (!inBrowser) return; | ||
/** | ||
* @param {string | null | undefined} ref | ||
* @returns {boolean | undefined} | ||
*/ | ||
function isExternalReferrer(ref) { | ||
@@ -249,4 +284,4 @@ if (!inBrowser) return false; | ||
* @param {string} param - param key to remove from current URL | ||
* @param {function} [callback] - callback function to run. Only runs in browser | ||
* @return {promise} | ||
* @param {() => void} [callback] - callback function to run. Only runs in browser | ||
* @return {PromiseLike<void>} | ||
*/ | ||
@@ -324,6 +359,13 @@ | ||
/** | ||
* @typedef {{ | ||
* campaign: string, | ||
* referrer?: string, | ||
* } & DomainObject & Object.<string, any>} ReferrerObject | ||
*/ | ||
/** | ||
* Checks a given url and parses referrer data | ||
* @param {String} [referrer] - (optional) referring URL | ||
* @param {String} [currentUrl] - (optional) the current url | ||
* @return {Object} [description] | ||
* @return {ReferrerObject} [description] | ||
*/ | ||
@@ -380,5 +422,13 @@ | ||
/** | ||
* @typedef {{ | ||
* source: string, | ||
* medium: string, | ||
* term?: string | ||
* }} DomainObject | ||
*/ | ||
/** | ||
* Client side domain parser for determining marketing data. | ||
* @param {String} referrer - ref url | ||
* @return {Object} | ||
* @return {DomainObject | boolean} | ||
*/ | ||
@@ -442,2 +492,5 @@ | ||
/** | ||
* @return {string} | ||
*/ | ||
function uuid() { | ||
@@ -444,0 +497,0 @@ var u = '', |
@@ -21,14 +21,40 @@ export { default as dotProp } from 'dlv'; | ||
} | ||
/** | ||
* @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) { | ||
@@ -55,2 +81,6 @@ if (_typeof(obj) !== 'object' || obj === null) return false; | ||
/** | ||
* @returns {string | undefined} | ||
*/ | ||
function getBrowserLocale() { | ||
@@ -73,2 +103,7 @@ if (!inBrowser) return; | ||
/** | ||
* @param {string | null | undefined} ref | ||
* @returns {boolean | undefined} | ||
*/ | ||
function isExternalReferrer(ref) { | ||
@@ -242,4 +277,4 @@ if (!inBrowser) return false; | ||
* @param {string} param - param key to remove from current URL | ||
* @param {function} [callback] - callback function to run. Only runs in browser | ||
* @return {promise} | ||
* @param {() => void} [callback] - callback function to run. Only runs in browser | ||
* @return {PromiseLike<void>} | ||
*/ | ||
@@ -317,6 +352,13 @@ | ||
/** | ||
* @typedef {{ | ||
* campaign: string, | ||
* referrer?: string, | ||
* } & DomainObject & Object.<string, any>} ReferrerObject | ||
*/ | ||
/** | ||
* Checks a given url and parses referrer data | ||
* @param {String} [referrer] - (optional) referring URL | ||
* @param {String} [currentUrl] - (optional) the current url | ||
* @return {Object} [description] | ||
* @return {ReferrerObject} [description] | ||
*/ | ||
@@ -373,5 +415,13 @@ | ||
/** | ||
* @typedef {{ | ||
* source: string, | ||
* medium: string, | ||
* term?: string | ||
* }} DomainObject | ||
*/ | ||
/** | ||
* Client side domain parser for determining marketing data. | ||
* @param {String} referrer - ref url | ||
* @return {Object} | ||
* @return {DomainObject | boolean} | ||
*/ | ||
@@ -435,2 +485,5 @@ | ||
/** | ||
* @return {string} | ||
*/ | ||
function uuid() { | ||
@@ -437,0 +490,0 @@ var u = '', |
@@ -28,14 +28,40 @@ 'use strict'; | ||
} | ||
/** | ||
* @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) { | ||
@@ -62,2 +88,6 @@ if (_typeof(obj) !== 'object' || obj === null) return false; | ||
/** | ||
* @returns {string | undefined} | ||
*/ | ||
function getBrowserLocale() { | ||
@@ -80,2 +110,7 @@ if (!inBrowser) return; | ||
/** | ||
* @param {string | null | undefined} ref | ||
* @returns {boolean | undefined} | ||
*/ | ||
function isExternalReferrer(ref) { | ||
@@ -249,4 +284,4 @@ if (!inBrowser) return false; | ||
* @param {string} param - param key to remove from current URL | ||
* @param {function} [callback] - callback function to run. Only runs in browser | ||
* @return {promise} | ||
* @param {() => void} [callback] - callback function to run. Only runs in browser | ||
* @return {PromiseLike<void>} | ||
*/ | ||
@@ -324,6 +359,13 @@ | ||
/** | ||
* @typedef {{ | ||
* campaign: string, | ||
* referrer?: string, | ||
* } & DomainObject & Object.<string, any>} ReferrerObject | ||
*/ | ||
/** | ||
* Checks a given url and parses referrer data | ||
* @param {String} [referrer] - (optional) referring URL | ||
* @param {String} [currentUrl] - (optional) the current url | ||
* @return {Object} [description] | ||
* @return {ReferrerObject} [description] | ||
*/ | ||
@@ -380,5 +422,13 @@ | ||
/** | ||
* @typedef {{ | ||
* source: string, | ||
* medium: string, | ||
* term?: string | ||
* }} DomainObject | ||
*/ | ||
/** | ||
* Client side domain parser for determining marketing data. | ||
* @param {String} referrer - ref url | ||
* @return {Object} | ||
* @return {DomainObject | boolean} | ||
*/ | ||
@@ -442,2 +492,5 @@ | ||
/** | ||
* @return {string} | ||
*/ | ||
function uuid() { | ||
@@ -444,0 +497,0 @@ var u = '', |
@@ -21,14 +21,40 @@ export { default as dotProp } from 'dlv'; | ||
} | ||
/** | ||
* @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) { | ||
@@ -55,2 +81,6 @@ if (_typeof(obj) !== 'object' || obj === null) return false; | ||
/** | ||
* @returns {string | undefined} | ||
*/ | ||
function getBrowserLocale() { | ||
@@ -73,2 +103,7 @@ if (!inBrowser) return; | ||
/** | ||
* @param {string | null | undefined} ref | ||
* @returns {boolean | undefined} | ||
*/ | ||
function isExternalReferrer(ref) { | ||
@@ -242,4 +277,4 @@ if (!inBrowser) return false; | ||
* @param {string} param - param key to remove from current URL | ||
* @param {function} [callback] - callback function to run. Only runs in browser | ||
* @return {promise} | ||
* @param {() => void} [callback] - callback function to run. Only runs in browser | ||
* @return {PromiseLike<void>} | ||
*/ | ||
@@ -317,6 +352,13 @@ | ||
/** | ||
* @typedef {{ | ||
* campaign: string, | ||
* referrer?: string, | ||
* } & DomainObject & Object.<string, any>} ReferrerObject | ||
*/ | ||
/** | ||
* Checks a given url and parses referrer data | ||
* @param {String} [referrer] - (optional) referring URL | ||
* @param {String} [currentUrl] - (optional) the current url | ||
* @return {Object} [description] | ||
* @return {ReferrerObject} [description] | ||
*/ | ||
@@ -373,5 +415,13 @@ | ||
/** | ||
* @typedef {{ | ||
* source: string, | ||
* medium: string, | ||
* term?: string | ||
* }} DomainObject | ||
*/ | ||
/** | ||
* Client side domain parser for determining marketing data. | ||
* @param {String} referrer - ref url | ||
* @return {Object} | ||
* @return {DomainObject | boolean} | ||
*/ | ||
@@ -435,2 +485,5 @@ | ||
/** | ||
* @return {string} | ||
*/ | ||
function uuid() { | ||
@@ -437,0 +490,0 @@ var u = '', |
{ | ||
"name": "analytics-utils", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Analytics utility functions used by 'analytics' module", | ||
@@ -16,3 +16,3 @@ "author": "David Wells <hello@davidwells.io>", | ||
"watch": "rollup -w -c scripts/rollup.config.browser.es.js", | ||
"clean": "rimraf lib dist && mkdirp lib dist", | ||
"clean": "rimraf lib dist types && mkdirp lib dist types", | ||
"rollup-cjs": "rollup -c scripts/rollup.config.cjs.js && rollup -c scripts/rollup.config.browser.cjs.js", | ||
@@ -23,7 +23,8 @@ "rollup-es": "rollup -c scripts/rollup.config.es.js && rollup -c scripts/rollup.config.browser.es.js", | ||
"minify-dist": "uglifyjs -mc < dist/analytics-utils.js > dist/analytics-utils.min.js", | ||
"build": "npm-run-all clean rollup minify-dist", | ||
"build": "npm-run-all clean rollup types minify-dist", | ||
"publish": "git push origin && git push origin --tags", | ||
"release:patch": "npm version patch && npm publish", | ||
"release:minor": "npm version minor && npm publish", | ||
"release:major": "npm version major && npm publish" | ||
"release:major": "npm version major && npm publish", | ||
"types": "tsc" | ||
}, | ||
@@ -38,4 +39,6 @@ "keywords": [ | ||
"lib", | ||
"types", | ||
"README.md" | ||
], | ||
"types": "./types/index.d.ts", | ||
"devDependencies": { | ||
@@ -60,2 +63,3 @@ "@ampproject/rollup-plugin-closure-compiler": "^0.8.5", | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"typescript": "^4.2.3", | ||
"uglify-js": "^3.4.9" | ||
@@ -67,3 +71,6 @@ }, | ||
}, | ||
"gitHead": "54924261b60e44fa00841b8b3e740918d2e660c5" | ||
"peerDependencies": { | ||
"@types/dlv": "^1.0.0" | ||
}, | ||
"gitHead": "87394ecd762454a54b515d243b07d9984de81059" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102475
30
2801
3
20