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

analytics-client

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics-client - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0-getQueryString-changes-d883b3d288bc529829aaf58798d9c18e037f5487

7

CHANGELOG.md

@@ -7,5 +7,10 @@ # Change Log

# v1.3.0
# v1.4.0
## (2021-02-25)
* Changed getQueryString to validate domains [Ezequiel Boehler]
# v1.3.0
## (2021-02-24)
* Don't store session ID in a cookie [Pranas Ziaukas]

@@ -12,0 +17,0 @@ * Implement session ID parsing and logic [Pranas Ziaukas]

2

dist/package.json
{
"name": "analytics-client",
"version": "1.3.0",
"version": "1.4.0-getQueryString-changes-d883b3d288bc529829aaf58798d9c18e037f5487",
"description": "Convenient builders to compose analytics tools",

@@ -5,0 +5,0 @@ "repository": {

@@ -19,4 +19,4 @@ import { Client } from './client';

getSessionIdQueryString(): string;
getQueryString(): string;
getQueryString(destinationHostname?: string): string;
isOptOutRequested(): boolean;
}

@@ -102,6 +102,16 @@ "use strict";

};
AnalyticsUrlParams.prototype.getQueryString = function () {
return [this.getDeviceIdsQueryString(), this.getSessionIdQueryString()]
.filter(function (x) { return x; })
.join('&');
AnalyticsUrlParams.prototype.getQueryString = function (destinationHostname) {
var regex = /([a-zA-Z0-9-]+)(\.[a-zA-Z]{2,5})?(\.[a-zA-Z]+$)/g;
var actualDomain = window.location.hostname.match(regex);
var destinationDomain = destinationHostname
? destinationHostname.match(regex)
: undefined;
if (actualDomain !== destinationDomain) {
return [this.getDeviceIdsQueryString(), this.getSessionIdQueryString()]
.filter(function (x) { return x; })
.join('&');
}
else {
return '';
}
};

@@ -108,0 +118,0 @@ AnalyticsUrlParams.prototype.isOptOutRequested = function () {

{
"name": "analytics-client",
"version": "1.3.0",
"version": "1.4.0-getQueryString-changes-d883b3d288bc529829aaf58798d9c18e037f5487",
"description": "Convenient builders to compose analytics tools",

@@ -5,0 +5,0 @@ "repository": {

@@ -166,6 +166,16 @@ import * as Cookies from 'js-cookie';

*/
getQueryString(): string {
return [this.getDeviceIdsQueryString(), this.getSessionIdQueryString()]
.filter(x => x)
.join('&');
getQueryString(destinationHostname?: string): string {
const regex = /([a-zA-Z0-9-]+)(\.[a-zA-Z]{2,5})?(\.[a-zA-Z]+$)/g;
const actualDomain = window.location.hostname.match(regex);
const destinationDomain = destinationHostname
? destinationHostname.match(regex)
: undefined;
if (actualDomain !== destinationDomain) {
return [this.getDeviceIdsQueryString(), this.getSessionIdQueryString()]
.filter(x => x)
.join('&');
} else {
return '';
}
}

@@ -172,0 +182,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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