BVB Source Codes

reactide Show template-literals.js Source code

Return Download reactide: download template-literals.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. exports.__esModule = true;
  4. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  5. exports.TemplateElement = TemplateElement;
  6. exports.TemplateLiteral = TemplateLiteral;
  7. function TaggedTemplateExpression(node) {
  8.   this.print(node.tag, node);
  9.   this.print(node.quasi, node);
  10. }
  11.  
  12. function TemplateElement(node, parent) {
  13.   var isFirst = parent.quasis[0] === node;
  14.   var isLast = parent.quasis[parent.quasis.length - 1] === node;
  15.  
  16.   var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
  17.  
  18.   this.token(value);
  19. }
  20.  
  21. function TemplateLiteral(node) {
  22.   var quasis = node.quasis;
  23.  
  24.   for (var i = 0; i < quasis.length; i++) {
  25.     this.print(quasis[i], node);
  26.  
  27.     if (i + 1 < quasis.length) {
  28.       this.print(node.expressions[i], node);
  29.     }
  30.   }
  31. }
downloadtemplate-literals.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top