Skip to content

Commit

Permalink
docs: add comment about optional parameter (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jun 11, 2023
1 parent d7ad4ba commit e194847
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/update-endpoints/templates/endpoints.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
type ExtractParameters<T> = "parameters" extends keyof T
? UnionToIntersection<
{
// query paramter might be optional
// https://github.com/octokit/types.ts/pull/555#issuecomment-1585105522
[K in keyof T["parameters"]]-?: T["parameters"][K];
}[keyof T["parameters"]]
>
Expand Down
2 changes: 2 additions & 0 deletions src/generated/Endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
type ExtractParameters<T> = "parameters" extends keyof T
? UnionToIntersection<
{
// query paramter might be optional
// https://github.com/octokit/types.ts/pull/555#issuecomment-1585105522
[K in keyof T["parameters"]]-?: T["parameters"][K];
}[keyof T["parameters"]]
>
Expand Down

0 comments on commit e194847

Please sign in to comment.