Skip to content

Commit

Permalink
fix: use string join instead of templates (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Jul 30, 2024
1 parent 052221a commit 354d175
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,11 @@ private void addCommandSpecificPlugins() {
return;
}
writer.openBlock(", { ", " }", () -> {
writer
.pushState()
.putContext("params", additionalParameters)
.writeInline("${#params}${value:L}, ${/params}")
.popState();
// caution: using String.join instead of templating
// because additionalParameters may contain Smithy syntax.
if (!additionalParameters.isEmpty()) {
writer.writeInline(String.join(", ", additionalParameters) + ", ");
}
clientAddParamsWriterConsumers.forEach((key, consumer) -> {
writer.writeInline("$L: $C,", key, (Consumer<TypeScriptWriter>) (w -> {
consumer.accept(w, CommandConstructorCodeSection.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,11 @@ private void generateConstructor() {
}

writer.openBlock(", {", " }", () -> {
writer
.pushState()
.putContext("params", additionalParameters)
.writeInline("${#params}${value:L}, ${/params}")
.popState();
// caution: using String.join instead of templating
// because additionalParameters may contain Smithy syntax.
if (!additionalParameters.isEmpty()) {
writer.writeInline(String.join(", ", additionalParameters) + ", ");
}
clientAddParamsWriterConsumers.forEach((key, consumer) -> {
writer.writeInline("$L: $C,", key, (Consumer<TypeScriptWriter>) (w -> {
consumer.accept(w, ClientBodyExtraCodeSection.builder()
Expand Down

0 comments on commit 354d175

Please sign in to comment.