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.

getMockName.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 _getRequireWildcardCache(nodeInterop) {
  14. if (typeof WeakMap !== 'function') return null;
  15. var cacheBabelInterop = new WeakMap();
  16. var cacheNodeInterop = new WeakMap();
  17. return (_getRequireWildcardCache = function (nodeInterop) {
  18. return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
  19. })(nodeInterop);
  20. }
  21. function _interopRequireWildcard(obj, nodeInterop) {
  22. if (!nodeInterop && obj && obj.__esModule) {
  23. return obj;
  24. }
  25. if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
  26. return {default: obj};
  27. }
  28. var cache = _getRequireWildcardCache(nodeInterop);
  29. if (cache && cache.has(obj)) {
  30. return cache.get(obj);
  31. }
  32. var newObj = {};
  33. var hasPropertyDescriptor =
  34. Object.defineProperty && Object.getOwnPropertyDescriptor;
  35. for (var key in obj) {
  36. if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
  37. var desc = hasPropertyDescriptor
  38. ? Object.getOwnPropertyDescriptor(obj, key)
  39. : null;
  40. if (desc && (desc.get || desc.set)) {
  41. Object.defineProperty(newObj, key, desc);
  42. } else {
  43. newObj[key] = obj[key];
  44. }
  45. }
  46. }
  47. newObj.default = obj;
  48. if (cache) {
  49. cache.set(obj, newObj);
  50. }
  51. return newObj;
  52. }
  53. /**
  54. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  55. *
  56. * This source code is licensed under the MIT license found in the
  57. * LICENSE file in the root directory of this source tree.
  58. */
  59. const MOCKS_PATTERN = path().sep + '__mocks__' + path().sep;
  60. const getMockName = filePath => {
  61. const mockPath = filePath.split(MOCKS_PATTERN)[1];
  62. return mockPath
  63. .substring(0, mockPath.lastIndexOf(path().extname(mockPath)))
  64. .replace(/\\/g, '/');
  65. };
  66. var _default = getMockName;
  67. exports.default = _default;