Skip to content

Commit 3ea2ea4

Browse files
rybbchaostanley-cheung
authored andcommitted
Fix output dts about 'repeated' for --grpc-web_out=import_style=commonjs+dts
1 parent e02d010 commit 3ea2ea4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

javascript/net/grpc/web/grpc_generator.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,10 @@ void PrintProtoDtsFile(Printer* printer, const FileDescriptor* file) {
542542
js_field_type = "{}";
543543
break;
544544
}
545+
if (it->second->field(i)->is_repeated()) {
546+
vars["js_field_name"] += "List";
547+
js_field_type += "[]";
548+
}
545549
vars["js_field_type"] = js_field_type;
546550
printer->Print(vars, "get$js_field_name$(): $js_field_type$;\n");
547551
printer->Print(vars, "set$js_field_name$(a: $js_field_type$): void;\n");

0 commit comments

Comments
 (0)