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.

setTimeout.js 1.2KB

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. async function setTimeout(timeouts) {
  4. if (typeof timeouts !== 'object') {
  5. throw new Error('Parameter for "setTimeout" command needs to be an object');
  6. }
  7. const timeoutValues = Object.values(timeouts);
  8. if (timeoutValues.length && timeoutValues.every(timeout => typeof timeout !== 'number' || timeout < 0 || timeout > Number.MAX_SAFE_INTEGER)) {
  9. throw new Error('Specified timeout values are not valid integer (see https://webdriver.io/docs/api/browser/setTimeout.html for documentation).');
  10. }
  11. const implicit = timeouts.implicit;
  12. const pageLoad = timeouts['page load'] || timeouts.pageLoad;
  13. const script = timeouts.script;
  14. const setTimeouts = this.setTimeouts.bind(this);
  15. if (!this.isW3C) {
  16. await Promise.all([
  17. isFinite(implicit) && setTimeouts('implicit', implicit),
  18. isFinite(pageLoad) && setTimeouts('page load', pageLoad),
  19. isFinite(script) && setTimeouts('script', script),
  20. ].filter(Boolean));
  21. return;
  22. }
  23. return setTimeouts(implicit, pageLoad, script);
  24. }
  25. exports.default = setTimeout;