Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/integrationCapture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ export default class IntegrationCapture {
return mappedClickIds;
}

for (const [key, value] of Object.entries(clickIds)) {
const mappedKey = mappingList[key]?.mappedKey;
if (!isEmpty(mappedKey)) {
mappedClickIds[mappedKey] = value;
for (const key in clickIds) {
if (clickIds.hasOwnProperty(key)) {
const value = clickIds[key];
const mappedKey = mappingList[key]?.mappedKey;
if (!isEmpty(mappedKey)) {
mappedClickIds[mappedKey] = value;
}
}
}

Expand All @@ -207,12 +210,11 @@ export default class IntegrationCapture {
): Dictionary<string> {
const processedClickIds: Dictionary<string> = {};

for (const [key, value] of Object.entries(clickIds)) {
const processor = integrationMapping[key]?.processor;
if (processor) {
processedClickIds[key] = processor(value, url, timestamp);
} else {
processedClickIds[key] = value;
for (const key in clickIds) {
if (clickIds.hasOwnProperty(key)) {
const value = clickIds[key];
const processor = integrationMapping[key]?.processor;
processedClickIds[key] = processor ? processor(value, url, timestamp) : value;
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/uploaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export class XHRUploader extends AsyncUploader {

xhr.open(method, url);

Object.entries(headers).forEach(([key, value]) => {
xhr.setRequestHeader(key, value);
});
for (const key in headers) {
if (headers.hasOwnProperty(key)) {
xhr.setRequestHeader(key, headers[key]);
}
}

xhr.send(data);
});
Expand Down
Loading