searchNumbers.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = searchNumbers;
  6. var _normalizeArguments2 = _interopRequireDefault(require("../normalizeArguments.js"));
  7. var _PhoneNumberMatcher = _interopRequireDefault(require("../PhoneNumberMatcher.js"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  9. 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; }
  10. /**
  11. * @return ES6 `for ... of` iterator.
  12. */
  13. function searchNumbers() {
  14. var _normalizeArguments = (0, _normalizeArguments2["default"])(arguments),
  15. text = _normalizeArguments.text,
  16. options = _normalizeArguments.options,
  17. metadata = _normalizeArguments.metadata;
  18. var matcher = new _PhoneNumberMatcher["default"](text, options, metadata);
  19. return _defineProperty({}, Symbol.iterator, function () {
  20. return {
  21. next: function next() {
  22. if (matcher.hasNext()) {
  23. return {
  24. done: false,
  25. value: matcher.next()
  26. };
  27. }
  28. return {
  29. done: true
  30. };
  31. }
  32. };
  33. });
  34. }
  35. //# sourceMappingURL=searchNumbers.js.map