Skip to content

Commit 272579e

Browse files
committed
Rename variables, update test name
1 parent e4ca1ed commit 272579e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Rokt-Kit.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var constructor = function () {
2222
var EMAIL_KEY = 'email';
2323

2424
// Dynamic identity type for Rokt's emailsha256 identity value which MP doesn't natively support - will be set during initialization
25-
var MAPPED_EMAIL_SHA256_IDENTITY;
25+
var mappedEmailSha256Key;
2626

2727
self.name = name;
2828
self.moduleId = moduleId;
@@ -91,7 +91,7 @@ var constructor = function () {
9191
// Set dynamic OTHER_IDENTITY based on server settings
9292
// Convert to lowercase since server sends TitleCase (e.g., 'Other' -> 'other')
9393
if (settings.hashedEmailUserIdentityType) {
94-
MAPPED_EMAIL_SHA256_IDENTITY =
94+
mappedEmailSha256Key =
9595
settings.hashedEmailUserIdentityType.toLowerCase();
9696
}
9797

@@ -178,16 +178,16 @@ var constructor = function () {
178178

179179
function replaceOtherIdentityWithEmailsha256(userIdentities) {
180180
var newUserIdentities = mergeObjects({}, userIdentities || {});
181-
if (userIdentities.hasOwnProperty(MAPPED_EMAIL_SHA256_IDENTITY)) {
181+
if (userIdentities.hasOwnProperty(mappedEmailSha256Key)) {
182182
newUserIdentities[EMAIL_SHA256_KEY] =
183-
userIdentities[MAPPED_EMAIL_SHA256_IDENTITY];
184-
delete newUserIdentities[MAPPED_EMAIL_SHA256_IDENTITY];
183+
userIdentities[mappedEmailSha256Key];
184+
delete newUserIdentities[mappedEmailSha256Key];
185185
}
186186

187187
return newUserIdentities;
188188
}
189189

190-
function sanitizeIdentities(_data) {
190+
function sanitizeEmailIdentities(_data) {
191191
var data = mergeObjects({}, _data || {});
192192
if (_data.hasOwnProperty(EMAIL_SHA256_KEY)) {
193193
delete data[EMAIL_KEY];
@@ -255,7 +255,7 @@ var constructor = function () {
255255
);
256256

257257
var selectPlacementsOptions = mergeObjects(options, {
258-
attributes: sanitizeIdentities(selectPlacementsAttributes),
258+
attributes: sanitizeEmailIdentities(selectPlacementsAttributes),
259259
});
260260

261261
return self.launcher.selectPlacements(selectPlacementsOptions);

test/src/tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ describe('Rokt Forwarder', () => {
13231323
);
13241324
});
13251325

1326-
it('should pass the attribute other in selectPlacements directly to Rokt', async () => {
1326+
it('should pass the attribute `other` in selectPlacements directly to Rokt', async () => {
13271327
window.mParticle.Rokt.filters = {
13281328
userAttributeFilters: [],
13291329
filterUserAttributes: function (attributes) {

0 commit comments

Comments
 (0)