Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/identity

Package Overview
Dependencies
Maintainers
9
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/identity - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

6

dist/src/identity.d.ts

@@ -5,3 +5,3 @@ import { Identity, IdentityListener } from '@amplitude/types';

private _userId;
private _identityListeners;
private readonly _identityListeners;
static generateDefaultId: () => string;

@@ -22,5 +22,5 @@ /**

private _alertIdentityListeners;
addIdentityListener(...listeners: Array<IdentityListener>): void;
getIdentityListeners(): Array<IdentityListener>;
addIdentityListener(...listeners: IdentityListener[]): void;
getIdentityListeners(): IdentityListener[];
}
//# sourceMappingURL=identity.d.ts.map
import { Identity } from '@amplitude/types';
declare class IdentityManager {
private _instanceMap;
private readonly _instanceMap;
getInstance(instanceName?: string, optionalFallbackIdentity?: Identity | null): Identity;

@@ -5,0 +5,0 @@ /**

@@ -15,3 +15,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var identity = this._instanceMap.get(instanceName);
if (identity == undefined) {
if (identity === undefined) {
identity = optionalFallbackIdentity !== null ? optionalFallbackIdentity : new identity_1.DefaultIdentity();

@@ -29,7 +29,8 @@ this._instanceMap.set(instanceName, identity);

var e_1, _a;
var _b;
if (instanceName === void 0) { instanceName = types_1.DEFAULT_IDENTITY_INSTANCE; }
if (optionalNewIdentity === void 0) { optionalNewIdentity = null; }
var oldIdentity = this._instanceMap.get(instanceName);
var oldListeners = (oldIdentity === null || oldIdentity === void 0 ? void 0 : oldIdentity.getIdentityListeners()) || [];
if (!oldIdentity) {
var oldListeners = (_b = oldIdentity === null || oldIdentity === void 0 ? void 0 : oldIdentity.getIdentityListeners()) !== null && _b !== void 0 ? _b : [];
if (oldIdentity === undefined) {
utils_1.logger.warn("Did not find a identity to reset for " + instanceName);

@@ -73,3 +74,3 @@ }

exports.identityManager = identityManager;
if (!identityManager) {
if (identityManager === undefined) {
exports.identityManager = identityManager = new IdentityManager();

@@ -76,0 +77,0 @@ globalNamespace.identityManager = identityManager;

@@ -5,3 +5,3 @@ import { Identity, IdentityListener } from '@amplitude/types';

private _userId;
private _identityListeners;
private readonly _identityListeners;
static generateDefaultId: () => string;

@@ -22,5 +22,5 @@ /**

private _alertIdentityListeners;
addIdentityListener(...listeners: Array<IdentityListener>): void;
getIdentityListeners(): Array<IdentityListener>;
addIdentityListener(...listeners: IdentityListener[]): void;
getIdentityListeners(): IdentityListener[];
}
//# sourceMappingURL=identity.d.ts.map
import { Identity } from '@amplitude/types';
declare class IdentityManager {
private _instanceMap;
private readonly _instanceMap;
getInstance(instanceName?: string, optionalFallbackIdentity?: Identity | null): Identity;

@@ -5,0 +5,0 @@ /**

@@ -13,3 +13,3 @@ import { __read, __spread, __values } from "tslib";

var identity = this._instanceMap.get(instanceName);
if (identity == undefined) {
if (identity === undefined) {
identity = optionalFallbackIdentity !== null ? optionalFallbackIdentity : new DefaultIdentity();

@@ -27,7 +27,8 @@ this._instanceMap.set(instanceName, identity);

var e_1, _a;
var _b;
if (instanceName === void 0) { instanceName = DEFAULT_IDENTITY_INSTANCE; }
if (optionalNewIdentity === void 0) { optionalNewIdentity = null; }
var oldIdentity = this._instanceMap.get(instanceName);
var oldListeners = (oldIdentity === null || oldIdentity === void 0 ? void 0 : oldIdentity.getIdentityListeners()) || [];
if (!oldIdentity) {
var oldListeners = (_b = oldIdentity === null || oldIdentity === void 0 ? void 0 : oldIdentity.getIdentityListeners()) !== null && _b !== void 0 ? _b : [];
if (oldIdentity === undefined) {
logger.warn("Did not find a identity to reset for " + instanceName);

@@ -70,3 +71,3 @@ }

var identityManager = globalNamespace.identityManager;
if (!identityManager) {
if (identityManager === undefined) {
identityManager = new IdentityManager();

@@ -73,0 +74,0 @@ globalNamespace.identityManager = identityManager;

{
"name": "@amplitude/identity",
"version": "1.0.4",
"version": "1.1.0",
"description": "Identity Manager for JS-based SDK's to help track device and user ID's",

@@ -19,4 +19,6 @@ "repository": "git://github.com/amplitude/Amplitude-Node.git",

"dependencies": {
"@amplitude/types": "^1.0.4",
"@amplitude/utils": "^1.0.4"
"@amplitude/eslint-config-typescript": "^1.1.0",
"@amplitude/types": "^1.1.0",
"@amplitude/utils": "^1.1.0",
"tslib": "^1.9.3"
},

@@ -48,3 +50,3 @@ "devDependencies": {

"sideEffects": false,
"gitHead": "24c1bdd5219a6d2ef9f5c134f47c5322062f4047"
"gitHead": "ea5ccaa5f17d29b47dd17a65e16da2fe154798f2"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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