Skip to content

Commit

Permalink
perf(core): fix object shorthand issue with minification (#1002)
Browse files Browse the repository at this point in the history
perf(core): fix object shorthand issue with minification
  • Loading branch information
JagadeeshKaricherla-branch authored Mar 5, 2024
1 parent 1b095f8 commit 5e98ad1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/1_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,11 +1337,10 @@ utils.shouldAddDMAParams = function(endPointURL) {
utils.setDMAParams = function(data, dmaObj = {}, endPoint) {
const v1_DMAEndPoints = [ "/v1/open", "/v1/pageview" ];
const v2_DMAEndPoints = [ "/v2/event/standard", "/v2/event/custom" ];
const dmaParams = {
dma_eea: dmaObj['eeaRegion'],
dma_ad_personalization: dmaObj['adPersonalizationConsent'],
dma_ad_user_data: dmaObj['adUserDataUsageConsent']
};
const dmaParams = {};
dmaParams['dma_eea'] = dmaObj['eeaRegion'];
dmaParams['dma_ad_personalization'] = dmaObj['adPersonalizationConsent'];
dmaParams['dma_ad_user_data'] = dmaObj['adUserDataUsageConsent'];
if (v1_DMAEndPoints.includes(endPoint)) {
Object.assign(data, dmaParams);
}
Expand Down
9 changes: 4 additions & 5 deletions src/6_branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1973,11 +1973,10 @@ Branch.prototype['setDMAParamsForEEA'] = wrap(callback_params.CALLBACK_ERR, func
return;
}

const dmaObj = {
eeaRegion,
adPersonalizationConsent,
adUserDataUsageConsent
};
const dmaObj = {};
dmaObj['eeaRegion'] = eeaRegion;
dmaObj['adPersonalizationConsent'] = adPersonalizationConsent;
dmaObj['adUserDataUsageConsent'] = adUserDataUsageConsent;

this._storage.set('branch_dma_data', safejson.stringify(dmaObj), true);
} catch (e) {
Expand Down

0 comments on commit 5e98ad1

Please sign in to comment.