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.

index.js 758B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. // We define these manually to ensure they're always copied
  3. // even if they would move up the prototype chain
  4. // https://nodejs.org/api/http.html#http_class_http_incomingmessage
  5. const knownProps = [
  6. 'destroy',
  7. 'setTimeout',
  8. 'socket',
  9. 'headers',
  10. 'trailers',
  11. 'rawHeaders',
  12. 'statusCode',
  13. 'httpVersion',
  14. 'httpVersionMinor',
  15. 'httpVersionMajor',
  16. 'rawTrailers',
  17. 'statusMessage'
  18. ];
  19. module.exports = (fromStream, toStream) => {
  20. const fromProps = new Set(Object.keys(fromStream).concat(knownProps));
  21. for (const prop of fromProps) {
  22. // Don't overwrite existing properties
  23. if (prop in toStream) {
  24. continue;
  25. }
  26. toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];
  27. }
  28. };