Skip to content

Commit 9c78154

Browse files
committed
comment: Clarify descriptive comments in createStatementsFromExpandedPlaceholders()
1 parent 344b60d commit 9c78154

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Query/Query.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,19 @@ ${source}`;
169169
}
170170

171171
private createStatementsFromExpandedPlaceholders(expandedSource: string, statement: Statement) {
172+
// Trim and filter empty lines in one step.
172173
const expandedSourceLines = expandedSource
173174
.split('\n')
174175
.map((line) => line.trim())
175176
.filter((line) => line.length > 0);
177+
176178
if (expandedSourceLines.length === 1) {
177-
// Save any expanded text back in to the statement:
179+
// Save the single expanded line back into the statement.
178180
statement.recordExpandedPlaceholders(expandedSourceLines[0]);
179181
return [statement];
180182
}
181183

182-
// The expanded source is more than one line, so we will need to create multiple statements.
183-
// This only happens if the placeholder was a multiple-line property from the query file.
184+
// Handle multiple-line placeholders.
184185
return expandedSourceLines.map((expandedSourceLine, index) => {
185186
const counter = `: statement ${index + 1} after expansion of placeholder`;
186187
const newStatement = new Statement(

0 commit comments

Comments
 (0)