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.

template-literals.js 898B

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  6. exports.TemplateElement = TemplateElement;
  7. exports.TemplateLiteral = TemplateLiteral;
  8. var t = require("@babel/types");
  9. function TaggedTemplateExpression(node) {
  10. this.print(node.tag, node);
  11. this.print(node.typeParameters, node);
  12. this.print(node.quasi, node);
  13. }
  14. function TemplateElement(node, parent) {
  15. const isFirst = parent.quasis[0] === node;
  16. const isLast = parent.quasis[parent.quasis.length - 1] === node;
  17. const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
  18. this.token(value);
  19. }
  20. function TemplateLiteral(node) {
  21. const quasis = node.quasis;
  22. for (let i = 0; i < quasis.length; i++) {
  23. this.print(quasis[i], node);
  24. if (i + 1 < quasis.length) {
  25. this.print(node.expressions[i], node);
  26. }
  27. }
  28. }