Skip to content

Commit

Permalink
adding fix (#2434)
Browse files Browse the repository at this point in the history
Co-authored-by: Manik Mehta <[email protected]>
  • Loading branch information
ManikMM and Manik Mehta authored Sep 24, 2024
1 parent 163ed7f commit 113afe4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function getMetadata(
function getAdId(device_type?: string, advertising_id?: string): { [key: string]: string | undefined } | undefined {
if (!device_type) return undefined
if (!advertising_id) return undefined
return device_type === 'Apple' ? { idfa: hash(advertising_id) } : { aaid: hash(advertising_id) }
return device_type === 'ios' ? { idfa: hash(advertising_id) } : { aaid: hash(advertising_id) }
}

function getDataProcessingOptions(
Expand Down Expand Up @@ -158,7 +158,7 @@ function getUser(
function canonicalizeEmail(value: string): string {
const localPartAndDomain = value.split('@')
const localPart = localPartAndDomain[0].replace(/\./g, '').split('+')[0]
return `${localPart}@${localPartAndDomain[1].toLowerCase()}`
return `${localPart.toLowerCase()}@${localPartAndDomain[1].toLowerCase()}`
}

const hash = (value: string | undefined, isEmail = false): string | undefined => {
Expand Down

0 comments on commit 113afe4

Please sign in to comment.