Closed adius closed 6 years ago
If somebody (me) stores e.g. the cellPhone as a number, it will crash the whole formatter. (https://github.com/enesser/vCards-js/blob/master/lib/vCardFormatter.js#L223) as it means you're trying to generate an array with a certain size which can lead to errors if the range is too large.
cellPhone
E.g. new Array(12345678900) will throw following error:
new Array(12345678900)
RangeError: Invalid array length at Object.getFormattedString (/Project/node_modules/vcards-js/lib/vCardFormatter.js:254:39) at Object.getFormattedString (/Project/node_modules/vcards-js/index.js:321:35) ...
So vCard.cellPhone = new Array(vCard.cellPhone); should be replaced with vCard.cellPhone = [vCard.cellPhone];
vCard.cellPhone = new Array(vCard.cellPhone);
vCard.cellPhone = [vCard.cellPhone];
Thank you! Added to next version.
If somebody (me) stores e.g. the
cellPhone
as a number, it will crash the whole formatter. (https://github.com/enesser/vCards-js/blob/master/lib/vCardFormatter.js#L223) as it means you're trying to generate an array with a certain size which can lead to errors if the range is too large.E.g.
new Array(12345678900)
will throw following error:So
vCard.cellPhone = new Array(vCard.cellPhone);
should be replaced withvCard.cellPhone = [vCard.cellPhone];