Skip to content

Commit

Permalink
remove prefix and add calling code to phone aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrayson676 committed Oct 3, 2024
1 parent 436e5a0 commit 3c3823c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/aggregations/phone.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ const _ = require('lodash');

module.exports = function (phone) {
if (phone != null && !phone.valid) { return; }
return _.pick(phone, 'type', 'country_code', 'prefix', 'area', 'exchange', 'is_tollfree');
return _.pick(phone, 'type', 'country_code', 'country_calling_code', 'area', 'exchange', 'is_tollfree');
};
4 changes: 4 additions & 0 deletions test/aggregate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ describe('Phone aggregation', function () {
assert.equal(phone.country_code, 'US');
});

it('should include country calling code', function () {
assert.equal(phone.country_calling_code, 1);
});

it('should not include line number', function () {
assert.isUndefined(phone.line);
});
Expand Down

0 comments on commit 3c3823c

Please sign in to comment.