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.

modules.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.ImportSpecifier = ImportSpecifier;
  6. exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
  7. exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
  8. exports.ExportSpecifier = ExportSpecifier;
  9. exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
  10. exports.ExportAllDeclaration = ExportAllDeclaration;
  11. exports.ExportNamedDeclaration = ExportNamedDeclaration;
  12. exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
  13. exports.ImportDeclaration = ImportDeclaration;
  14. exports.ImportAttribute = ImportAttribute;
  15. exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
  16. var t = require("@babel/types");
  17. function ImportSpecifier(node) {
  18. if (node.importKind === "type" || node.importKind === "typeof") {
  19. this.word(node.importKind);
  20. this.space();
  21. }
  22. this.print(node.imported, node);
  23. if (node.local && node.local.name !== node.imported.name) {
  24. this.space();
  25. this.word("as");
  26. this.space();
  27. this.print(node.local, node);
  28. }
  29. }
  30. function ImportDefaultSpecifier(node) {
  31. this.print(node.local, node);
  32. }
  33. function ExportDefaultSpecifier(node) {
  34. this.print(node.exported, node);
  35. }
  36. function ExportSpecifier(node) {
  37. this.print(node.local, node);
  38. if (node.exported && node.local.name !== node.exported.name) {
  39. this.space();
  40. this.word("as");
  41. this.space();
  42. this.print(node.exported, node);
  43. }
  44. }
  45. function ExportNamespaceSpecifier(node) {
  46. this.token("*");
  47. this.space();
  48. this.word("as");
  49. this.space();
  50. this.print(node.exported, node);
  51. }
  52. function ExportAllDeclaration(node) {
  53. this.word("export");
  54. this.space();
  55. if (node.exportKind === "type") {
  56. this.word("type");
  57. this.space();
  58. }
  59. this.token("*");
  60. this.space();
  61. this.word("from");
  62. this.space();
  63. this.print(node.source, node);
  64. this.printAssertions(node);
  65. this.semicolon();
  66. }
  67. function ExportNamedDeclaration(node) {
  68. if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
  69. this.printJoin(node.declaration.decorators, node);
  70. }
  71. this.word("export");
  72. this.space();
  73. ExportDeclaration.apply(this, arguments);
  74. }
  75. function ExportDefaultDeclaration(node) {
  76. if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
  77. this.printJoin(node.declaration.decorators, node);
  78. }
  79. this.word("export");
  80. this.space();
  81. this.word("default");
  82. this.space();
  83. ExportDeclaration.apply(this, arguments);
  84. }
  85. function ExportDeclaration(node) {
  86. if (node.declaration) {
  87. const declar = node.declaration;
  88. this.print(declar, node);
  89. if (!t.isStatement(declar)) this.semicolon();
  90. } else {
  91. if (node.exportKind === "type") {
  92. this.word("type");
  93. this.space();
  94. }
  95. const specifiers = node.specifiers.slice(0);
  96. let hasSpecial = false;
  97. for (;;) {
  98. const first = specifiers[0];
  99. if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
  100. hasSpecial = true;
  101. this.print(specifiers.shift(), node);
  102. if (specifiers.length) {
  103. this.token(",");
  104. this.space();
  105. }
  106. } else {
  107. break;
  108. }
  109. }
  110. if (specifiers.length || !specifiers.length && !hasSpecial) {
  111. this.token("{");
  112. if (specifiers.length) {
  113. this.space();
  114. this.printList(specifiers, node);
  115. this.space();
  116. }
  117. this.token("}");
  118. }
  119. if (node.source) {
  120. this.space();
  121. this.word("from");
  122. this.space();
  123. this.print(node.source, node);
  124. this.printAssertions(node);
  125. }
  126. this.semicolon();
  127. }
  128. }
  129. function ImportDeclaration(node) {
  130. this.word("import");
  131. this.space();
  132. if (node.importKind === "type" || node.importKind === "typeof") {
  133. this.word(node.importKind);
  134. this.space();
  135. }
  136. const specifiers = node.specifiers.slice(0);
  137. if (specifiers != null && specifiers.length) {
  138. for (;;) {
  139. const first = specifiers[0];
  140. if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
  141. this.print(specifiers.shift(), node);
  142. if (specifiers.length) {
  143. this.token(",");
  144. this.space();
  145. }
  146. } else {
  147. break;
  148. }
  149. }
  150. if (specifiers.length) {
  151. this.token("{");
  152. this.space();
  153. this.printList(specifiers, node);
  154. this.space();
  155. this.token("}");
  156. }
  157. this.space();
  158. this.word("from");
  159. this.space();
  160. }
  161. this.print(node.source, node);
  162. this.printAssertions(node);
  163. {
  164. var _node$attributes;
  165. if ((_node$attributes = node.attributes) != null && _node$attributes.length) {
  166. this.space();
  167. this.word("with");
  168. this.space();
  169. this.printList(node.attributes, node);
  170. }
  171. }
  172. this.semicolon();
  173. }
  174. function ImportAttribute(node) {
  175. this.print(node.key);
  176. this.token(":");
  177. this.space();
  178. this.print(node.value);
  179. }
  180. function ImportNamespaceSpecifier(node) {
  181. this.token("*");
  182. this.space();
  183. this.word("as");
  184. this.space();
  185. this.print(node.local, node);
  186. }