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.

isEqual.js 843B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const constants_1 = require("../../constants");
  4. const utils_1 = require("../../utils");
  5. const getWebElement = (el) => ({
  6. [constants_1.ELEMENT_KEY]: el.elementId,
  7. ELEMENT: el.elementId
  8. });
  9. async function isEqual(el) {
  10. const browser = utils_1.getBrowserObject(this);
  11. if (browser.isMobile) {
  12. const context = await browser.getContext();
  13. if (context === null || context === void 0 ? void 0 : context.toLowerCase().includes('native')) {
  14. return this.elementId === el.elementId;
  15. }
  16. }
  17. let result;
  18. try {
  19. result = await browser.execute((el1, el2) => el1 === el2, getWebElement(this), getWebElement(el));
  20. }
  21. catch (err) {
  22. result = false;
  23. }
  24. return result;
  25. }
  26. exports.default = isEqual;