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

123456789101112131415161718192021222324252627282930
  1. /**
  2. * node-compress-commons
  3. *
  4. * Copyright (c) 2014 Chris Talkington, contributors.
  5. * Licensed under the MIT license.
  6. * https://github.com/archiverjs/node-compress-commons/blob/master/LICENSE-MIT
  7. */
  8. var Stream = require('stream').Stream;
  9. var PassThrough = require('readable-stream').PassThrough;
  10. var util = module.exports = {};
  11. util.isStream = function(source) {
  12. return source instanceof Stream;
  13. };
  14. util.normalizeInputSource = function(source) {
  15. if (source === null) {
  16. return Buffer.alloc(0);
  17. } else if (typeof source === 'string') {
  18. return Buffer.from(source);
  19. } else if (util.isStream(source) && !source._readableState) {
  20. var normalized = new PassThrough();
  21. source.pipe(normalized);
  22. return normalized;
  23. }
  24. return source;
  25. };