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.

addCookie.js 557B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. async function addCookie({ cookie }) {
  4. const page = this.getPageHandle();
  5. const cookieProps = Object.keys(cookie);
  6. if (!cookieProps.includes('name') || !cookieProps.includes('value')) {
  7. throw new Error('Provided cookie object is missing either "name" or "value" property');
  8. }
  9. if (typeof cookie.value !== 'string') {
  10. cookie.value = cookie.value.toString();
  11. }
  12. await page.setCookie(cookie);
  13. return null;
  14. }
  15. exports.default = addCookie;