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.

ModuleNotFoundError.js 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function path() {
  7. const data = _interopRequireWildcard(require('path'));
  8. path = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _slash() {
  14. const data = _interopRequireDefault(require('slash'));
  15. _slash = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. function _interopRequireDefault(obj) {
  21. return obj && obj.__esModule ? obj : {default: obj};
  22. }
  23. function _getRequireWildcardCache(nodeInterop) {
  24. if (typeof WeakMap !== 'function') return null;
  25. var cacheBabelInterop = new WeakMap();
  26. var cacheNodeInterop = new WeakMap();
  27. return (_getRequireWildcardCache = function (nodeInterop) {
  28. return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  29. })(nodeInterop);
  30. }
  31. function _interopRequireWildcard(obj, nodeInterop) {
  32. if (!nodeInterop && obj && obj.__esModule) {
  33. return obj;
  34. }
  35. if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
  36. return {default: obj};
  37. }
  38. var cache = _getRequireWildcardCache(nodeInterop);
  39. if (cache && cache.has(obj)) {
  40. return cache.get(obj);
  41. }
  42. var newObj = {};
  43. var hasPropertyDescriptor =
  44. Object.defineProperty && Object.getOwnPropertyDescriptor;
  45. for (var key in obj) {
  46. if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
  47. var desc = hasPropertyDescriptor
  48. ? Object.getOwnPropertyDescriptor(obj, key)
  49. : null;
  50. if (desc && (desc.get || desc.set)) {
  51. Object.defineProperty(newObj, key, desc);
  52. } else {
  53. newObj[key] = obj[key];
  54. }
  55. }
  56. }
  57. newObj.default = obj;
  58. if (cache) {
  59. cache.set(obj, newObj);
  60. }
  61. return newObj;
  62. }
  63. function _defineProperty(obj, key, value) {
  64. if (key in obj) {
  65. Object.defineProperty(obj, key, {
  66. value: value,
  67. enumerable: true,
  68. configurable: true,
  69. writable: true
  70. });
  71. } else {
  72. obj[key] = value;
  73. }
  74. return obj;
  75. }
  76. class ModuleNotFoundError extends Error {
  77. constructor(message, moduleName) {
  78. super(message);
  79. _defineProperty(this, 'code', 'MODULE_NOT_FOUND');
  80. _defineProperty(this, 'hint', void 0);
  81. _defineProperty(this, 'requireStack', void 0);
  82. _defineProperty(this, 'siblingWithSimilarExtensionFound', void 0);
  83. _defineProperty(this, 'moduleName', void 0);
  84. _defineProperty(this, '_originalMessage', void 0);
  85. this._originalMessage = message;
  86. this.moduleName = moduleName;
  87. }
  88. buildMessage(rootDir) {
  89. var _this$requireStack;
  90. if (!this._originalMessage) {
  91. this._originalMessage = this.message || '';
  92. }
  93. let message = this._originalMessage;
  94. if (
  95. (_this$requireStack = this.requireStack) !== null &&
  96. _this$requireStack !== void 0 &&
  97. _this$requireStack.length &&
  98. this.requireStack.length > 1
  99. ) {
  100. message += `
  101. Require stack:
  102. ${this.requireStack
  103. .map(p => p.replace(`${rootDir}${path().sep}`, ''))
  104. .map(_slash().default)
  105. .join('\n ')}
  106. `;
  107. }
  108. if (this.hint) {
  109. message += this.hint;
  110. }
  111. this.message = message;
  112. }
  113. static duckType(error) {
  114. error.buildMessage = ModuleNotFoundError.prototype.buildMessage;
  115. return error;
  116. }
  117. }
  118. exports.default = ModuleNotFoundError;