libphonenumber-js
Version:
A simpler (and smaller) rewrite of Google Android's popular libphonenumber library
19 lines (16 loc) • 835 B
JavaScript
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
import PhoneNumber from './PhoneNumber';
import parse from './parse';
export default function parsePhoneNumber(text, defaultCountry, metadata) {
if (isObject(defaultCountry)) {
metadata = defaultCountry;
defaultCountry = undefined;
}
return parse(text, { defaultCountry: defaultCountry, v2: true }, metadata);
}
// so istanbul will show this as "branch not covered".
/* istanbul ignore next */
var isObject = function isObject(_) {
return (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';
};
//# sourceMappingURL=parsePhoneNumber.js.map