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.

comments.js 1000B

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
  6. exports.addComment = addComment;
  7. exports.addComments = addComments;
  8. var t = require("@babel/types");
  9. function shareCommentsWithSiblings() {
  10. if (typeof this.key === "string") return;
  11. const node = this.node;
  12. if (!node) return;
  13. const trailing = node.trailingComments;
  14. const leading = node.leadingComments;
  15. if (!trailing && !leading) return;
  16. const prev = this.getSibling(this.key - 1);
  17. const next = this.getSibling(this.key + 1);
  18. const hasPrev = Boolean(prev.node);
  19. const hasNext = Boolean(next.node);
  20. if (hasPrev && !hasNext) {
  21. prev.addComments("trailing", trailing);
  22. } else if (hasNext && !hasPrev) {
  23. next.addComments("leading", leading);
  24. }
  25. }
  26. function addComment(type, content, line) {
  27. t.addComment(this.node, type, content, line);
  28. }
  29. function addComments(type, comments) {
  30. t.addComments(this.node, type, comments);
  31. }