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.js 474B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const cloneRegexp = require('clone-regexp');
  3. module.exports = (regexp, string) => {
  4. let match;
  5. const matches = [];
  6. const clonedRegexp = cloneRegexp(regexp, {lastIndex: 0});
  7. const isGlobal = clonedRegexp.global;
  8. // eslint-disable-next-line no-cond-assign
  9. while (match = clonedRegexp.exec(string)) {
  10. matches.push({
  11. match: match[0],
  12. subMatches: match.slice(1),
  13. index: match.index
  14. });
  15. if (!isGlobal) {
  16. break;
  17. }
  18. }
  19. return matches;
  20. };