'use strict';

var index = require('../findCountryByPrefix/index.js');

/**
 * @param number Phone number in a format like "+447573135343"
 */
const explodeNumberModel = number => {
  const country = index.findCountryByPrefix(number);
  return country ? {
    prefix: country.phone,
    suffix: number.slice(country.phone.length),
    format: country.phoneFormat
  } : {
    prefix: null,
    suffix: number.slice(1)
  };
};

exports.explodeNumberModel = explodeNumberModel;
//# sourceMappingURL=index.js.map
