Skip to content

Commit

Permalink
review comments: move undefined type to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
anish749 authored and eandre committed Feb 12, 2024
1 parent ab06d3d commit 8d28ed9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions e2e-tests/testdata/echo_client/ts/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ type CallParameters = Omit<RequestInit, "method" | "body" | "headers"> & {
// AuthDataGenerator is a function that returns a new instance of the authentication data required by this API
export type AuthDataGenerator = () =>
| echo.AuthParams
| undefined
| Promise<echo.AuthParams | undefined>;
| Promise<echo.AuthParams | undefined>
| undefined;

// A fetcher is the prototype for the inbuilt Fetch function
export type Fetcher = typeof fetch;
Expand Down
4 changes: 2 additions & 2 deletions internal/clientgen/testdata/expected_baseauth_typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ type CallParameters = Omit<RequestInit, "method" | "body" | "headers"> & {
// AuthDataGenerator is a function that returns a new instance of the authentication data required by this API
export type AuthDataGenerator = () =>
| string
| undefined
| Promise<string | undefined>;
| Promise<string | undefined>
| undefined;

// A fetcher is the prototype for the inbuilt Fetch function
export type Fetcher = typeof fetch;
Expand Down
4 changes: 2 additions & 2 deletions internal/clientgen/testdata/expected_typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ type CallParameters = Omit<RequestInit, "method" | "body" | "headers"> & {
// AuthDataGenerator is a function that returns a new instance of the authentication data required by this API
export type AuthDataGenerator = () =>
| authentication.AuthData
| undefined
| Promise<authentication.AuthData | undefined>;
| Promise<authentication.AuthData | undefined>
| undefined;

// A fetcher is the prototype for the inbuilt Fetch function
export type Fetcher = typeof fetch;
Expand Down
4 changes: 2 additions & 2 deletions internal/clientgen/typescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,10 @@ export type AuthDataGenerator = () =>
| `)
ts.writeTyp("", ts.md.AuthHandler.Params, 0)
ts.WriteString(`
| undefined
| Promise<`)
ts.writeTyp("", ts.md.AuthHandler.Params, 0)
ts.WriteString(` | undefined>;`)
ts.WriteString(` | undefined>
| undefined;`)
}

ts.WriteString(`
Expand Down

0 comments on commit 8d28ed9

Please sign in to comment.