import parsePhoneNumberFromString from 'libphonenumber-js/min';
import CountryCodes from './CountryCodes';

export const getCountryByCodeId = (countryCode) => {
  return CountryCodes.find((c) => c.code === countryCode)?.dialCode;
};

export const matchingParenthesis = (val) => {
  const openParenMatches = val.match(/\(/g);
  const closeParenMatches = val.match(/\)/g);
  return openParenMatches?.length === closeParenMatches?.length;
};
