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.

fast_path.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.relative = relative;
  6. exports.resolve = resolve;
  7. function path() {
  8. const data = _interopRequireWildcard(require('path'));
  9. path = function () {
  10. return data;
  11. };
  12. return data;
  13. }
  14. function _getRequireWildcardCache(nodeInterop) {
  15. if (typeof WeakMap !== 'function') return null;
  16. var cacheBabelInterop = new WeakMap();
  17. var cacheNodeInterop = new WeakMap();
  18. return (_getRequireWildcardCache = function (nodeInterop) {
  19. return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  20. })(nodeInterop);
  21. }
  22. function _interopRequireWildcard(obj, nodeInterop) {
  23. if (!nodeInterop && obj && obj.__esModule) {
  24. return obj;
  25. }
  26. if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
  27. return {default: obj};
  28. }
  29. var cache = _getRequireWildcardCache(nodeInterop);
  30. if (cache && cache.has(obj)) {
  31. return cache.get(obj);
  32. }
  33. var newObj = {};
  34. var hasPropertyDescriptor =
  35. Object.defineProperty && Object.getOwnPropertyDescriptor;
  36. for (var key in obj) {
  37. if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
  38. var desc = hasPropertyDescriptor
  39. ? Object.getOwnPropertyDescriptor(obj, key)
  40. : null;
  41. if (desc && (desc.get || desc.set)) {
  42. Object.defineProperty(newObj, key, desc);
  43. } else {
  44. newObj[key] = obj[key];
  45. }
  46. }
  47. }
  48. newObj.default = obj;
  49. if (cache) {
  50. cache.set(obj, newObj);
  51. }
  52. return newObj;
  53. }
  54. /**
  55. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  56. *
  57. * This source code is licensed under the MIT license found in the
  58. * LICENSE file in the root directory of this source tree.
  59. */
  60. // rootDir and filename must be absolute paths (resolved)
  61. function relative(rootDir, filename) {
  62. return filename.indexOf(rootDir + path().sep) === 0
  63. ? filename.substr(rootDir.length + 1)
  64. : path().relative(rootDir, filename);
  65. }
  66. const INDIRECTION_FRAGMENT = '..' + path().sep; // rootDir must be an absolute path and relativeFilename must be simple
  67. // (e.g.: foo/bar or ../foo/bar, but never ./foo or foo/../bar)
  68. function resolve(rootDir, relativeFilename) {
  69. return relativeFilename.indexOf(INDIRECTION_FRAGMENT) === 0
  70. ? path().resolve(rootDir, relativeFilename)
  71. : rootDir + path().sep + relativeFilename;
  72. }