From 3c3823cdd34f1656031a6064ee9c37aabb9aca59 Mon Sep 17 00:00:00 2001 From: Jonathan Grayson Date: Thu, 3 Oct 2024 09:44:26 -0500 Subject: [PATCH] remove prefix and add calling code to phone aggregations --- lib/aggregations/phone.js | 2 +- test/aggregate.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/aggregations/phone.js b/lib/aggregations/phone.js index 537ddee..4dd50f5 100644 --- a/lib/aggregations/phone.js +++ b/lib/aggregations/phone.js @@ -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'); }; diff --git a/test/aggregate.test.js b/test/aggregate.test.js index 7b43d1d..3215e19 100644 --- a/test/aggregate.test.js +++ b/test/aggregate.test.js @@ -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); });