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.

custom$$.js 897B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const utils_1 = require("../../utils");
  4. const getElementObject_1 = require("../../utils/getElementObject");
  5. const constants_1 = require("../../constants");
  6. async function custom$$(strategyName, ...strategyArguments) {
  7. const strategy = this.strategies.get(strategyName);
  8. if (!strategy) {
  9. throw Error('No strategy found for ' + strategyName);
  10. }
  11. let res = await this.execute(strategy, ...strategyArguments);
  12. if (!Array.isArray(res)) {
  13. res = [res];
  14. }
  15. res = res.filter(el => !!el && typeof el[constants_1.ELEMENT_KEY] === 'string');
  16. const elements = res.length ? await getElementObject_1.getElements.call(this, strategy.toString(), res) : [];
  17. return utils_1.enhanceElementsArray(elements, this, strategyName, 'custom$$', [strategyArguments]);
  18. }
  19. exports.default = custom$$;