@mparticle/web-sdk
Advanced tools
Comparing version 2.26.6 to 2.26.7
{ | ||
"name": "@mparticle/web-sdk", | ||
"version": "2.26.6", | ||
"version": "2.26.7", | ||
"description": "mParticle core SDK for web applications", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -28,2 +28,3 @@ import { Batch } from '@mparticle/event-models'; | ||
isObject, | ||
moveElementToEnd, | ||
parseNumber, | ||
@@ -190,2 +191,3 @@ returnConvertedBoolean, | ||
addMpidToSessionHistory?(mpid: MPID, previousMpid?: MPID): void; | ||
hasInvalidIdentifyRequest?: () => boolean; | ||
@@ -499,2 +501,18 @@ nullifySession?: () => void; | ||
this.addMpidToSessionHistory = (mpid: MPID, previousMPID?: MPID): void => { | ||
const indexOfMPID = this.currentSessionMPIDs.indexOf(mpid); | ||
if (mpid && previousMPID !== mpid && indexOfMPID < 0) { | ||
this.currentSessionMPIDs.push(mpid); | ||
return; | ||
} | ||
if (indexOfMPID >= 0) { | ||
this.currentSessionMPIDs = moveElementToEnd( | ||
this.currentSessionMPIDs, | ||
indexOfMPID | ||
); | ||
} | ||
}; | ||
this.getFirstSeenTime = (mpid: MPID) => { | ||
@@ -501,0 +519,0 @@ if (!mpid) { |
@@ -0,1 +1,3 @@ | ||
import { getIdentityName } from './type-utils'; | ||
var MessageType = { | ||
@@ -212,46 +214,3 @@ SessionStart: 1, | ||
IdentityType.getIdentityName = function(identityType) { | ||
switch (identityType) { | ||
case IdentityType.Other: | ||
return 'other'; | ||
case IdentityType.CustomerId: | ||
return 'customerid'; | ||
case IdentityType.Facebook: | ||
return 'facebook'; | ||
case IdentityType.Twitter: | ||
return 'twitter'; | ||
case IdentityType.Google: | ||
return 'google'; | ||
case IdentityType.Microsoft: | ||
return 'microsoft'; | ||
case IdentityType.Yahoo: | ||
return 'yahoo'; | ||
case IdentityType.Email: | ||
return 'email'; | ||
case IdentityType.FacebookCustomAudienceId: | ||
return 'facebookcustomaudienceid'; | ||
case IdentityType.Other2: | ||
return 'other2'; | ||
case IdentityType.Other3: | ||
return 'other3'; | ||
case IdentityType.Other4: | ||
return 'other4'; | ||
case IdentityType.Other5: | ||
return 'other5'; | ||
case IdentityType.Other6: | ||
return 'other6'; | ||
case IdentityType.Other7: | ||
return 'other7'; | ||
case IdentityType.Other8: | ||
return 'other8'; | ||
case IdentityType.Other9: | ||
return 'other9'; | ||
case IdentityType.Other10: | ||
return 'other10'; | ||
case IdentityType.MobileNumber: | ||
return 'mobile_number'; | ||
case IdentityType.PhoneNumber2: | ||
return 'phone_number_2'; | ||
case IdentityType.PhoneNumber3: | ||
return 'phone_number_3'; | ||
} | ||
return getIdentityName(identityType); | ||
}; | ||
@@ -258,0 +217,0 @@ |
@@ -232,2 +232,5 @@ import Constants from './constants'; | ||
const moveElementToEnd = <T>(array: T[], index: number): T[] => | ||
array.slice(0, index).concat(array.slice(index + 1), array[index]); | ||
export { | ||
@@ -262,2 +265,3 @@ createCookieString, | ||
mergeObjects, | ||
moveElementToEnd, | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1544705
51
27872