<commit_before>import { reduce, sort } from 'ramda';
import isBlank from './isBlank';

export const AllContactSourceName = 'all';

export function addPhoneToContact(contact, phone, type) {
  if (isBlank(phone)) {
    return;
  }
  const existedPhone = contact.phoneNumbers.find(
    number => number && number.phoneNumber === phone
  );
  if (existedPhone) {
    existedPhone.phoneType = type;
  } else {
    contact.phoneNumbers.push({
      phoneNumber: phone,
      phoneType: type,
    });<commit_msg>fix(contactHelper): recorrecting personal contact phone type (#1450)<commit_after>import { reduce, sort } from 'ramda';
import isBlank from './isBlank';

export const AllContactSourceName = 'all';

export function addPhoneToContact(contact, phone, type) {
  if (isBlank(phone)) {
    return;
  }
  const existedPhone = contact.phoneNumbers.find(
    number => number && number.phoneNumber === phone
  );
  if (existedPhone) {
    existedPhone.phoneType = type;
  } else {
    contact.phoneNumbers.push({
      phoneNumber: phone,
      phoneType: type.replace('Phone', ''),
    });
{'fraction_non_alphanumeric': 0.1289134438305709, 'fraction_numerical': 0.003683241252302026, 'mean_word_length': 3.874439461883408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6536379', 'n_tokens_mistral': 338, 'n_tokens_neox': 331, 'n_words': 82}