Skip to content

Commit

Permalink
fix: #66
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Oct 30, 2019
1 parent b67bf7d commit 5fd8ffa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ export function emitFile(
return emitRegularExpressionLiteral(<ts.RegularExpressionLiteral>node);

case SyntaxKind.StringLiteral:
case SyntaxKind.NoSubstitutionTemplateLiteral:
case SyntaxKind.NoSubstitutionTemplateLiteral: // `abc`
return emitLiteral(<ts.LiteralExpression>node);

// // Identifiers
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function getLiteralText(node: ts.LiteralLikeNode, sourceFile: ts.SourceFi
return '"' + escapeText(node.text, ts.CharacterCodes.doubleQuote) + '"';
}
case ts.SyntaxKind.NoSubstitutionTemplateLiteral:
return "`" + escapeText(escapeText(node.text, ts.CharacterCodes.backtick), ts.CharacterCodes.doubleQuote) + "`";
return '"' + escapeText(escapeText(node.text, ts.CharacterCodes.backtick), ts.CharacterCodes.doubleQuote) + '"';
case ts.SyntaxKind.TemplateHead:
// tslint:disable-next-line no-invalid-template-strings
return '"' + escapeText(escapeText(node.text, ts.CharacterCodes.backtick), ts.CharacterCodes.doubleQuote) + '" ' + ".";
Expand Down
2 changes: 1 addition & 1 deletion test/features/template.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const b = '123';
const b = `123`;
const c = `0${b}45'6'"789"`;
const s = `1${b}2${b}3${b}4`;

0 comments on commit 5fd8ffa

Please sign in to comment.