File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11import { expandGlob } from "@std/fs" ;
22import * as ts from "typescript" ;
33import type { Extractions } from "./Extractions.ts" ;
4+ import { escapeKey } from "../common/escapeKey.ts" ;
45
56/**
67 * Represents a TypeScript source file and provides utilities for parsing and extracting
@@ -86,12 +87,12 @@ export class TypeScriptSourceFile {
8687 let templateString : string ;
8788 const tpl = node . template ;
8889 if ( ts . isNoSubstitutionTemplateLiteral ( tpl ) ) {
89- templateString = tpl . text ;
90+ templateString = escapeKey ( tpl . text ) ;
9091 } else if ( ts . isTemplateExpression ( tpl ) ) {
91- let parts = tpl . head . text ;
92+ let parts = escapeKey ( tpl . head . text ) ;
9293 tpl . templateSpans . forEach ( ( _ , index ) => {
9394 const span = tpl . templateSpans [ index ] ;
94- parts += "{" + index + "}" + span . literal . text ;
95+ parts += "{" + index + "}" + escapeKey ( span . literal . text ) ;
9596 } ) ;
9697 templateString = parts ;
9798 } else {
You can’t perform that action at this time.
0 commit comments