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.

main-umd.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  3. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.RegExtras = {}));
  5. }(this, (function (exports) { 'use strict';
  6. function _classCallCheck(instance, Constructor) {
  7. if (!(instance instanceof Constructor)) {
  8. throw new TypeError("Cannot call a class as a function");
  9. }
  10. }
  11. function _defineProperties(target, props) {
  12. for (var i = 0; i < props.length; i++) {
  13. var descriptor = props[i];
  14. descriptor.enumerable = descriptor.enumerable || false;
  15. descriptor.configurable = true;
  16. if ("value" in descriptor) descriptor.writable = true;
  17. Object.defineProperty(target, descriptor.key, descriptor);
  18. }
  19. }
  20. function _createClass(Constructor, protoProps, staticProps) {
  21. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  22. if (staticProps) _defineProperties(Constructor, staticProps);
  23. return Constructor;
  24. }
  25. function _setPrototypeOf(o, p) {
  26. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  27. o.__proto__ = p;
  28. return o;
  29. };
  30. return _setPrototypeOf(o, p);
  31. }
  32. function _isNativeReflectConstruct() {
  33. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  34. if (Reflect.construct.sham) return false;
  35. if (typeof Proxy === "function") return true;
  36. try {
  37. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  38. return true;
  39. } catch (e) {
  40. return false;
  41. }
  42. }
  43. function _construct(Parent, args, Class) {
  44. if (_isNativeReflectConstruct()) {
  45. _construct = Reflect.construct;
  46. } else {
  47. _construct = function _construct(Parent, args, Class) {
  48. var a = [null];
  49. a.push.apply(a, args);
  50. var Constructor = Function.bind.apply(Parent, a);
  51. var instance = new Constructor();
  52. if (Class) _setPrototypeOf(instance, Class.prototype);
  53. return instance;
  54. };
  55. }
  56. return _construct.apply(null, arguments);
  57. }
  58. /* eslint-disable node/no-unsupported-features/es-syntax */
  59. /**
  60. * @param {RegExp} regex
  61. * @param {string} newFlags
  62. * @param {Integer} [newLastIndex=regex.lastIndex]
  63. * @returns {RegExp}
  64. */
  65. function mixinRegex(regex, newFlags) {
  66. var newLastIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : regex.lastIndex;
  67. newFlags = newFlags || '';
  68. regex = new RegExp(regex.source, (newFlags.includes('g') ? 'g' : regex.global ? 'g' : '') + (newFlags.includes('i') ? 'i' : regex.ignoreCase ? 'i' : '') + (newFlags.includes('m') ? 'm' : regex.multiline ? 'm' : '') + (newFlags.includes('u') ? 'u' : regex.unicode ? 'u' : '') + (newFlags.includes('y') ? 'y' : regex.sticky ? 'y' : '') + (newFlags.includes('s') ? 's' : regex.dotAll ? 's' : ''));
  69. regex.lastIndex = newLastIndex;
  70. return regex;
  71. }
  72. exports.RegExtras = /*#__PURE__*/function () {
  73. function RegExtras(regex, flags, newLastIndex) {
  74. _classCallCheck(this, RegExtras);
  75. this.regex = mixinRegex(typeof regex === 'string' ? new RegExp(regex) : mixinRegex(regex), flags || '', newLastIndex);
  76. }
  77. _createClass(RegExtras, [{
  78. key: "forEach",
  79. value: function forEach(str, cb) {
  80. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  81. var regex = mixinRegex(this.regex, 'g');
  82. var matches,
  83. n0,
  84. i = 0;
  85. while ((matches = regex.exec(str)) !== null) {
  86. n0 = matches.splice(0, 1);
  87. cb.apply(thisObj, matches.concat(i++, n0));
  88. }
  89. return this;
  90. }
  91. }, {
  92. key: "some",
  93. value: function some(str, cb) {
  94. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  95. var regex = mixinRegex(this.regex, 'g');
  96. var matches,
  97. ret,
  98. n0,
  99. i = 0;
  100. while ((matches = regex.exec(str)) !== null) {
  101. n0 = matches.splice(0, 1);
  102. ret = cb.apply(thisObj, matches.concat(i++, n0));
  103. if (ret) {
  104. return true;
  105. }
  106. }
  107. return false;
  108. }
  109. }, {
  110. key: "every",
  111. value: function every(str, cb) {
  112. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  113. var regex = mixinRegex(this.regex, 'g');
  114. var matches,
  115. ret,
  116. n0,
  117. i = 0;
  118. while ((matches = regex.exec(str)) !== null) {
  119. n0 = matches.splice(0, 1);
  120. ret = cb.apply(thisObj, matches.concat(i++, n0));
  121. if (!ret) {
  122. return false;
  123. }
  124. }
  125. return true;
  126. }
  127. }, {
  128. key: "map",
  129. value: function map(str, cb) {
  130. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  131. var ret = [];
  132. var regex = mixinRegex(this.regex, 'g');
  133. var matches,
  134. n0,
  135. i = 0;
  136. while ((matches = regex.exec(str)) !== null) {
  137. n0 = matches.splice(0, 1);
  138. ret.push(cb.apply(thisObj, matches.concat(i++, n0)));
  139. }
  140. return ret;
  141. }
  142. }, {
  143. key: "filter",
  144. value: function filter(str, cb) {
  145. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  146. var matches,
  147. n0,
  148. i = 0;
  149. var ret = [],
  150. regex = mixinRegex(this.regex, 'g');
  151. while ((matches = regex.exec(str)) !== null) {
  152. n0 = matches.splice(0, 1);
  153. matches = matches.concat(i++, n0);
  154. if (cb.apply(thisObj, matches)) {
  155. ret.push(n0[0]);
  156. }
  157. }
  158. return ret;
  159. }
  160. }, {
  161. key: "reduce",
  162. value: function reduce(str, cb, prev) {
  163. var thisObj = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  164. var matches,
  165. n0,
  166. i = 0;
  167. var regex = mixinRegex(this.regex, 'g');
  168. if (!prev) {
  169. if ((matches = regex.exec(str)) !== null) {
  170. n0 = matches.splice(0, 1);
  171. prev = cb.apply(thisObj, [''].concat(matches.concat(i++, n0)));
  172. }
  173. }
  174. while ((matches = regex.exec(str)) !== null) {
  175. n0 = matches.splice(0, 1);
  176. prev = cb.apply(thisObj, [prev].concat(matches.concat(i++, n0)));
  177. }
  178. return prev;
  179. }
  180. }, {
  181. key: "reduceRight",
  182. value: function reduceRight(str, cb, prevOrig, thisObjOrig) {
  183. var matches,
  184. n0,
  185. i,
  186. thisObj = thisObjOrig,
  187. prev = prevOrig;
  188. var matchesContainer = [],
  189. regex = mixinRegex(this.regex, 'g');
  190. thisObj = thisObj || null;
  191. while ((matches = regex.exec(str)) !== null) {
  192. matchesContainer.push(matches);
  193. }
  194. i = matchesContainer.length;
  195. if (!i) {
  196. if (arguments.length < 3) {
  197. throw new TypeError('reduce of empty matches array with no initial value');
  198. }
  199. return prev;
  200. }
  201. if (!prev) {
  202. matches = matchesContainer.splice(-1)[0];
  203. n0 = matches.splice(0, 1);
  204. prev = cb.apply(thisObj, [''].concat(matches.concat(i--, n0)));
  205. }
  206. matchesContainer.reduceRight(function (container, mtches) {
  207. n0 = mtches.splice(0, 1);
  208. prev = cb.apply(thisObj, [prev].concat(mtches.concat(i--, n0)));
  209. return container;
  210. }, matchesContainer);
  211. return prev;
  212. }
  213. }, {
  214. key: "find",
  215. value: function find(str, cb) {
  216. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  217. var matches,
  218. ret,
  219. n0,
  220. i = 0;
  221. var regex = mixinRegex(this.regex, 'g');
  222. while ((matches = regex.exec(str)) !== null) {
  223. n0 = matches.splice(0, 1);
  224. ret = cb.apply(thisObj, matches.concat(i++, n0));
  225. if (ret) {
  226. return n0[0];
  227. }
  228. }
  229. return false;
  230. }
  231. }, {
  232. key: "findIndex",
  233. value: function findIndex(str, cb) {
  234. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  235. var regex = mixinRegex(this.regex, 'g');
  236. var matches,
  237. i = 0;
  238. while ((matches = regex.exec(str)) !== null) {
  239. var n0 = matches.splice(0, 1);
  240. var ret = cb.apply(thisObj, matches.concat(i++, n0));
  241. if (ret) {
  242. return i - 1;
  243. }
  244. }
  245. return -1;
  246. }
  247. }, {
  248. key: "findExec",
  249. value: function findExec(str, cb) {
  250. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  251. var regex = mixinRegex(this.regex, 'g');
  252. var matches,
  253. i = 0;
  254. while ((matches = regex.exec(str)) !== null) {
  255. var n0 = matches.splice(0, 1);
  256. var ret = cb.apply(thisObj, matches.concat(i++, n0));
  257. if (ret) {
  258. return matches;
  259. }
  260. }
  261. return false;
  262. }
  263. }, {
  264. key: "filterExec",
  265. value: function filterExec(str, cb) {
  266. var thisObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  267. var matches,
  268. n0,
  269. i = 0;
  270. var ret = [],
  271. regex = mixinRegex(this.regex, 'g');
  272. while ((matches = regex.exec(str)) !== null) {
  273. n0 = matches.splice(0, 1);
  274. matches.push(i++, n0[0]);
  275. if (cb.apply(thisObj, matches)) {
  276. ret.push(matches);
  277. }
  278. }
  279. return ret;
  280. }
  281. }]);
  282. return RegExtras;
  283. }();
  284. var _RegExtras = exports.RegExtras;
  285. exports.RegExtras = function RegExtras() {
  286. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  287. args[_key] = arguments[_key];
  288. }
  289. // eslint-disable-line no-class-assign
  290. return _construct(_RegExtras, args);
  291. };
  292. exports.RegExtras.prototype = _RegExtras.prototype;
  293. exports.RegExtras.mixinRegex = mixinRegex;
  294. exports.mixinRegex = mixinRegex;
  295. Object.defineProperty(exports, '__esModule', { value: true });
  296. })));