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.

item.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.createItemFromDescriptor = createItemFromDescriptor;
  6. exports.createConfigItem = createConfigItem;
  7. exports.getItemDescriptor = getItemDescriptor;
  8. function _path() {
  9. const data = require("path");
  10. _path = function () {
  11. return data;
  12. };
  13. return data;
  14. }
  15. var _configDescriptors = require("./config-descriptors");
  16. function createItemFromDescriptor(desc) {
  17. return new ConfigItem(desc);
  18. }
  19. function* createConfigItem(value, {
  20. dirname = ".",
  21. type
  22. } = {}) {
  23. const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), {
  24. type,
  25. alias: "programmatic item"
  26. });
  27. return createItemFromDescriptor(descriptor);
  28. }
  29. function getItemDescriptor(item) {
  30. if (item != null && item[CONFIG_ITEM_BRAND]) {
  31. return item._descriptor;
  32. }
  33. return undefined;
  34. }
  35. const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem");
  36. class ConfigItem {
  37. constructor(descriptor) {
  38. this._descriptor = void 0;
  39. this[CONFIG_ITEM_BRAND] = true;
  40. this.value = void 0;
  41. this.options = void 0;
  42. this.dirname = void 0;
  43. this.name = void 0;
  44. this.file = void 0;
  45. this._descriptor = descriptor;
  46. Object.defineProperty(this, "_descriptor", {
  47. enumerable: false
  48. });
  49. Object.defineProperty(this, CONFIG_ITEM_BRAND, {
  50. enumerable: false
  51. });
  52. this.value = this._descriptor.value;
  53. this.options = this._descriptor.options;
  54. this.dirname = this._descriptor.dirname;
  55. this.name = this._descriptor.name;
  56. this.file = this._descriptor.file ? {
  57. request: this._descriptor.file.request,
  58. resolved: this._descriptor.file.resolved
  59. } : undefined;
  60. Object.freeze(this);
  61. }
  62. }
  63. Object.freeze(ConfigItem.prototype);