Sha256: b5548f3e316970606b1d25f978b19caada38e8fb7ef6b1e70de6259363d054a3

Contents?: true

Size: 864 Bytes

Versions: 56

Compression:

Stored size: 864 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TaggedTemplateExpression = TaggedTemplateExpression;
exports.TemplateElement = TemplateElement;
exports.TemplateLiteral = TemplateLiteral;

function TaggedTemplateExpression(node) {
  this.print(node.tag, node);
  this.print(node.typeParameters, node);
  this.print(node.quasi, node);
}

function TemplateElement(node, parent) {
  const isFirst = parent.quasis[0] === node;
  const isLast = parent.quasis[parent.quasis.length - 1] === node;
  const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
  this.token(value);
}

function TemplateLiteral(node) {
  const quasis = node.quasis;

  for (let i = 0; i < quasis.length; i++) {
    this.print(quasis[i], node);

    if (i + 1 < quasis.length) {
      this.print(node.expressions[i], node);
    }
  }
}

Version data entries

56 entries across 56 versions & 9 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.18.0 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.18.2 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.7 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.6 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.5 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.4 node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.16.1 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.15.2 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.3 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.2 node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.18.4 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.18.1 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.14.0 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.1 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-4.3.5 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-5.0.0 node_modules/@babel/generator/lib/generators/template-literals.js
trusty-cms-4.3.4 node_modules/@babel/generator/lib/generators/template-literals.js