findPhoneNumbersInText.js 1.7 KB

1234567891011121314151617181920212223242526
  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 PhoneNumberMatcher from './PhoneNumberMatcher.js';
  5. import normalizeArguments from './normalizeArguments.js';
  6. export default function findPhoneNumbersInText() {
  7. var _normalizeArguments = normalizeArguments(arguments),
  8. text = _normalizeArguments.text,
  9. options = _normalizeArguments.options,
  10. metadata = _normalizeArguments.metadata;
  11. var matcher = new PhoneNumberMatcher(text, _objectSpread(_objectSpread({}, options), {}, {
  12. v2: true
  13. }), metadata);
  14. var results = [];
  15. while (matcher.hasNext()) {
  16. results.push(matcher.next());
  17. }
  18. return results;
  19. }
  20. //# sourceMappingURL=findPhoneNumbersInText.js.map