analytics-utils
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -29,4 +29,8 @@ 'use strict'; | ||
var _parseReferrerJs = require('./parseReferrer.js'); | ||
var _storage = require('./storage'); | ||
var _urlJs = require('./url.js'); | ||
var _uuidJs = require('./uuid.js'); | ||
@@ -49,3 +53,5 @@ | ||
exports.paramsRemove = _paramsRemoveJs; | ||
exports.parseReferrer = _parseReferrerJs; | ||
exports.storage = _storage; | ||
exports.url = _urlJs; | ||
exports.uuid = _uuidJs; |
@@ -6,12 +6,14 @@ 'use strict'; | ||
module.exports = isExternalReferrer; | ||
function isExternalReferrer() { | ||
if (inBrowser && document.referrer) { | ||
function isExternalReferrer(ref) { | ||
if (!inBrowser) return false; | ||
var referrer = ref || document.referrer; | ||
if (referrer) { | ||
var port = window.document.location.port; | ||
var ref = document.referrer.split('/')[2]; | ||
var _ref = referrer.split('/')[2]; | ||
if (port) { | ||
ref = ref.replace(':' + port, ''); | ||
_ref = _ref.replace(':' + port, ''); | ||
} | ||
return ref !== window.location.hostname; | ||
return _ref !== window.location.hostname; | ||
} | ||
return false; | ||
} |
@@ -21,3 +21,3 @@ 'use strict'; | ||
// replace URL | ||
history.replaceState({}, '', cleanUrl); | ||
history.replaceState({}, '', cleanUrl); // eslint-disable-line | ||
} | ||
@@ -24,0 +24,0 @@ } |
@@ -16,4 +16,6 @@ // @create-index | ||
export { default as paramsRemove } from './paramsRemove.js'; | ||
export { default as parseReferrer } from './parseReferrer.js'; | ||
export { default as storage } from './storage'; | ||
export { default as url } from './url.js'; | ||
export { default as uuid } from './uuid.js'; | ||
import inBrowser from './inBrowser' | ||
export default function isExternalReferrer() { | ||
if (inBrowser && document.referrer) { | ||
export default function isExternalReferrer(ref) { | ||
if (!inBrowser) return false | ||
const referrer = ref || document.referrer | ||
if (referrer) { | ||
const port = window.document.location.port | ||
let ref = document.referrer.split('/')[2] | ||
let ref = referrer.split('/')[2] | ||
if (port) { | ||
@@ -8,0 +10,0 @@ ref = ref.replace(`:${port}`, '') |
@@ -17,3 +17,3 @@ import inBrowser from './inBrowser' | ||
// replace URL | ||
history.replaceState({}, '', cleanUrl) | ||
history.replaceState({}, '', cleanUrl) // eslint-disable-line | ||
} | ||
@@ -29,2 +29,1 @@ } | ||
} | ||
{ | ||
"name": "analytics-utils", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "", | ||
@@ -50,3 +50,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "4dcf5fd82aab096a1792988597ba7d9cf63581f1" | ||
"gitHead": "0eae197f84f1e22f020b5e515e59954d2fee784e" | ||
} |
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
237834
43
6840