searchNumbers.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. 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; }
  2. import normalizeArguments from '../normalizeArguments.js';
  3. import PhoneNumberMatcher from '../PhoneNumberMatcher.js';
  4. /**
  5. * @return ES6 `for ... of` iterator.
  6. */
  7. export default function searchNumbers() {
  8. var _normalizeArguments = normalizeArguments(arguments),
  9. text = _normalizeArguments.text,
  10. options = _normalizeArguments.options,
  11. metadata = _normalizeArguments.metadata;
  12. var matcher = new PhoneNumberMatcher(text, options, metadata);
  13. return _defineProperty({}, Symbol.iterator, function () {
  14. return {
  15. next: function next() {
  16. if (matcher.hasNext()) {
  17. return {
  18. done: false,
  19. value: matcher.next()
  20. };
  21. }
  22. return {
  23. done: true
  24. };
  25. }
  26. };
  27. });
  28. }
  29. //# sourceMappingURL=searchNumbers.js.map