Skip to content

Commit

Permalink
Merge pull request #109 from Montellese/ts-ignore-missing-return
Browse files Browse the repository at this point in the history
add ts-ignore to avoid "TS7030: Not all code paths return a value."
  • Loading branch information
nenoNaninu authored Jun 10, 2023
2 parents f81fb37 + 9b9f1b0 commit 6314421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TypedSignalR.Client.TypeScript/Templates/ApiTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public constructor(
this.Write(this.ToStringHelper.ToStringWithCulture(hubType.Name));
this.Write(">;\r\n");
}
this.Write("}\r\n\r\nexport const getHubProxyFactory = ((hubType: string) => {\r\n");
this.Write("}\r\n\r\n// @ts-ignore\r\nexport const getHubProxyFactory = ((hubType: string) => {\r\n");
foreach(var hubType in HubTypes) {
this.Write(" if(hubType === \"");
this.Write(this.ToStringHelper.ToStringWithCulture(hubType.Name));
Expand All @@ -90,7 +90,8 @@ public constructor(
this.Write(this.ToStringHelper.ToStringWithCulture(receiverType.Name));
this.Write(">;\r\n");
}
this.Write("}\r\n\r\nexport const getReceiverRegister = ((receiverType: string) => {\r\n");
this.Write("}\r\n\r\n// @ts-ignore\r\nexport const getReceiverRegister = ((receiverType: string) =>" +
" {\r\n");
foreach(var receiverType in ReceiverTypes) {
this.Write(" if(receiverType === \"");
this.Write(this.ToStringHelper.ToStringWithCulture(receiverType.Name));
Expand Down
2 changes: 2 additions & 0 deletions src/TypedSignalR.Client.TypeScript/Templates/ApiTemplate.tt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type HubProxyFactoryProvider = {
<# } #>
}

// @ts-ignore
export const getHubProxyFactory = ((hubType: string) => {
<# foreach(var hubType in HubTypes) { #>
if(hubType === "<#= hubType.Name #>") {
Expand All @@ -64,6 +65,7 @@ export type ReceiverRegisterProvider = {
<# } #>
}

// @ts-ignore
export const getReceiverRegister = ((receiverType: string) => {
<# foreach(var receiverType in ReceiverTypes) { #>
if(receiverType === "<#= receiverType.Name #>") {
Expand Down

0 comments on commit 6314421

Please sign in to comment.