isPossiblePhoneNumber.js 1.6 KB

123456789101112131415161718192021
  1. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  2. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  3. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  4. import normalizeArguments from './normalizeArguments.js';
  5. import parsePhoneNumber from './parsePhoneNumber_.js';
  6. export default function isPossiblePhoneNumber() {
  7. var _normalizeArguments = normalizeArguments(arguments),
  8. text = _normalizeArguments.text,
  9. options = _normalizeArguments.options,
  10. metadata = _normalizeArguments.metadata;
  11. options = _objectSpread(_objectSpread({}, options), {}, {
  12. extract: false
  13. });
  14. var phoneNumber = parsePhoneNumber(text, options, metadata);
  15. return phoneNumber && phoneNumber.isPossible() || false;
  16. }
  17. //# sourceMappingURL=isPossiblePhoneNumber.js.map