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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@google-ads/datamanager": "^0.1.0",
"@google-ads/data-manager-util": "^0.2.0",
"@google-ads/data-manager-util": "^0.3.0",
"csv-parser": "^3.0.0",
"yargs": "^17.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google-ads/data-manager-util",
"version": "0.2.0",
"version": "0.3.0",
"description": "A utility library for the Data Manager API for Node.js.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions util/src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class UserDataFormatter {
}

if (domain === 'gmail.com' || domain === 'googlemail.com') {
username = username.split('+')[0];
username = username.replace(/\./g, '');
}

Expand Down
11 changes: 11 additions & 0 deletions util/test/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ describe('UserDataFormatter', () => {
expect(formatter.formatEmailAddress('QuinnY@EXAMPLE.com')).to.equal(
'quinny@example.com',
);
expect(
formatter.formatEmailAddress('user.name+NYC@Example.com'),
).to.equal('user.name+nyc@example.com');
});

it('should throw an error for invalid email addresses', () => {
Expand All @@ -47,6 +50,14 @@ describe('UserDataFormatter', () => {
expect(
formatter.formatEmailAddress('jefferson.Loves.hiking@googlemail.com'),
).to.equal('jeffersonloveshiking@googlemail.com');
expect(
formatter.formatEmailAddress('Cloudy.SanFrancisco+shopping@gmail.com'),
).to.equal('cloudysanfrancisco@gmail.com');
expect(
formatter.formatEmailAddress(
'Cloudy.SanFrancisco+shopping@googlemail.com',
),
).to.equal('cloudysanfrancisco@googlemail.com');
});
});

Expand Down