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.0.10 to 0.0.11

dist/parseReferrer.js

6

dist/index.js

@@ -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;

12

dist/isExternalReferrer.js

@@ -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"
}
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