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 786B

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