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.5.0-new-declareClient-function-2a23a9b5b8d8eecd28286388be89c415da729fc6 to 1.5.0-new-declareClient-function-3823032519f0872d044f54b69cfd3b8af7dfd679

4

CHANGELOG.md

@@ -8,5 +8,5 @@ # Change Log

# v1.5.0
## (2021-03-04)
## (2021-03-29)
* Created new declareClient function un url-params [Ezequiel Boehler]
* Updated setClient logic to handle new init methods [Ezequiel Boehler]

@@ -13,0 +13,0 @@ # v1.4.0

{
"name": "analytics-client",
"version": "1.5.0-new-declareClient-function-2a23a9b5b8d8eecd28286388be89c415da729fc6",
"version": "1.5.0-new-declareClient-function-3823032519f0872d044f54b69cfd3b8af7dfd679",
"description": "Convenient builders to compose analytics tools",

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

@@ -14,2 +14,3 @@ import { Client } from './client';

setClient(client: Client): void;
getClient(): Client | undefined;
allDeviceIds(): string[];

@@ -16,0 +17,0 @@ getPassedDeviceId(): string | undefined;

@@ -66,11 +66,18 @@ "use strict";

}
this.client = client;
if (!this.deviceIds) {
this.setDeviceIds(null, this.client.deviceId());
if (this.getPassedDeviceId() &&
this.getPassedDeviceId() !== client.deviceId()) {
var newDeviceId = this.setDeviceIds(null, client.deviceId());
if (newDeviceId != null) {
client.setDeviceId(newDeviceId);
}
}
if (this.sessionId && this.client.sessionId() !== this.sessionId) {
this.client.setSessionId(this.sessionId);
return;
if (this.sessionId && client.sessionId() !== this.sessionId) {
client.setSessionId(this.sessionId);
}
this.sessionId = client.sessionId();
this.client = client;
};
AnalyticsUrlParams.prototype.getClient = function () {
return this.client;
};
AnalyticsUrlParams.prototype.allDeviceIds = function () {

@@ -77,0 +84,0 @@ var currentId = this.client != null ? this.client.deviceId() : null;

@@ -88,3 +88,6 @@ "use strict";

this.deviceIdRetrieved = true;
return 'test_device_id';
if (!this.setDeviceIdParams) {
return 'test_device_id';
}
return this.setDeviceIdParams;
},

@@ -181,5 +184,2 @@ sessionId: function () {

}
else {
client.deviceId();
}
urlParams.setClient(client);

@@ -209,5 +209,2 @@ var allDeviceIds = urlParams.allDeviceIds();

}
else {
client.deviceId();
}
var allDeviceIds = urlParams.allDeviceIds();

@@ -218,3 +215,4 @@ urlParams.setClient(client);

expect(client.knownSessionId).toStrictEqual(123);
expect(urlParams.getClient()).toEqual(client);
});
//# sourceMappingURL=url-params.test.js.map
{
"name": "analytics-client",
"version": "1.5.0-new-declareClient-function-2a23a9b5b8d8eecd28286388be89c415da729fc6",
"version": "1.5.0-new-declareClient-function-3823032519f0872d044f54b69cfd3b8af7dfd679",
"description": "Convenient builders to compose analytics tools",

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

@@ -106,20 +106,20 @@ import * as Cookies from 'js-cookie';

}
this.client = client;
if (!this.deviceIds) {
this.setDeviceIds(null, this.client.deviceId());
if (
this.getPassedDeviceId() &&
this.getPassedDeviceId() !== client.deviceId()
) {
const newDeviceId = this.setDeviceIds(null, client.deviceId());
if (newDeviceId != null) {
client.setDeviceId(newDeviceId);
}
}
if (this.sessionId && this.client.sessionId() !== this.sessionId) {
this.client.setSessionId(this.sessionId);
return;
if (this.sessionId && client.sessionId() !== this.sessionId) {
client.setSessionId(this.sessionId);
}
this.sessionId = client.sessionId();
this.client = client;
}
// This can only return null if the function is called with no arguments, which I dont know if it makes sense to do that ever
// const newDeviceId = this.setDeviceIds(null, client.deviceId());
// In consecuence, this will always run and override the client deviceId with its already set same value.
// this is due to the fact that now client.deviceId() has already been set to the one of the inputIdString.
// if (newDeviceId != null) {
// client.setDeviceId(newDeviceId);
// }
getClient() {
return this.client;
}

@@ -126,0 +126,0 @@

@@ -156,3 +156,6 @@ import { Client, createNoopClient } from '../src/client';

this.deviceIdRetrieved = true;
return 'test_device_id';
if (!this.setDeviceIdParams) {
return 'test_device_id';
}
return this.setDeviceIdParams;
},

@@ -271,4 +274,2 @@ sessionId() {

client.setDeviceId(passedDeviceId);
} else {
client.deviceId();
}

@@ -303,4 +304,2 @@ urlParams.setClient(client);

client.setDeviceId(passedDeviceId);
} else {
client.deviceId();
}

@@ -312,2 +311,3 @@ const allDeviceIds = urlParams.allDeviceIds();

expect(client.knownSessionId).toStrictEqual(123);
expect(urlParams.getClient()).toEqual(client);
});

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

Sorry, the diff of this file is not supported yet

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