Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index-generators-es.js 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* eslint-disable node/no-unsupported-features/es-syntax */
  2. // We copy the regular expression so as to be able to always
  3. // ensure the exec expression is a global one (and thereby prevent recursion)
  4. /**
  5. *
  6. * @param {RegExtras} RegExtras
  7. * @returns {void}
  8. */
  9. function addPrototypeMethods(RegExtras) {
  10. RegExtras.prototype.entries = /*#__PURE__*/regeneratorRuntime.mark(function _callee(str) {
  11. var matches, i, regex;
  12. return regeneratorRuntime.wrap(function _callee$(_context) {
  13. while (1) {
  14. switch (_context.prev = _context.next) {
  15. case 0:
  16. i = 0;
  17. regex = RegExtras.mixinRegex(this.regex, 'g');
  18. case 2:
  19. if (!((matches = regex.exec(str)) !== null)) {
  20. _context.next = 7;
  21. break;
  22. }
  23. _context.next = 5;
  24. return [i++, matches];
  25. case 5:
  26. _context.next = 2;
  27. break;
  28. case 7:
  29. case "end":
  30. return _context.stop();
  31. }
  32. }
  33. }, _callee, this);
  34. });
  35. RegExtras.prototype.values = /*#__PURE__*/regeneratorRuntime.mark(function _callee2(str) {
  36. var matches, regex;
  37. return regeneratorRuntime.wrap(function _callee2$(_context2) {
  38. while (1) {
  39. switch (_context2.prev = _context2.next) {
  40. case 0:
  41. regex = RegExtras.mixinRegex(this.regex, 'g');
  42. case 1:
  43. if (!((matches = regex.exec(str)) !== null)) {
  44. _context2.next = 6;
  45. break;
  46. }
  47. _context2.next = 4;
  48. return matches;
  49. case 4:
  50. _context2.next = 1;
  51. break;
  52. case 6:
  53. case "end":
  54. return _context2.stop();
  55. }
  56. }
  57. }, _callee2, this);
  58. });
  59. RegExtras.prototype.keys = /*#__PURE__*/regeneratorRuntime.mark(function _callee3(str) {
  60. var i, regex;
  61. return regeneratorRuntime.wrap(function _callee3$(_context3) {
  62. while (1) {
  63. switch (_context3.prev = _context3.next) {
  64. case 0:
  65. i = 0;
  66. regex = RegExtras.mixinRegex(this.regex, 'g');
  67. case 2:
  68. if (!(regex.exec(str) !== null)) {
  69. _context3.next = 7;
  70. break;
  71. }
  72. _context3.next = 5;
  73. return i++;
  74. case 5:
  75. _context3.next = 2;
  76. break;
  77. case 7:
  78. case "end":
  79. return _context3.stop();
  80. }
  81. }
  82. }, _callee3, this);
  83. });
  84. }
  85. export default addPrototypeMethods;