Skip to content

Commit 22c67c8

Browse files
authored
Merge pull request #13 from cuppachino/changeset-release/main
Version Packages
2 parents 1607d9c + a72d568 commit 22c67c8

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

.changeset/eight-rocks-watch.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/stupid-tomatoes-ring.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @cuppachino/openapi-fetch
22

3+
## 2.1.0
4+
5+
### Minor Changes
6+
7+
- 7aec33f: created fetches that previously required a `Record<string, never>` (empty object) as its first argument now allow that argument to be undefined.
8+
9+
### Patch Changes
10+
11+
- ce0f69a: make `Record<string, never>` payloads optional
12+
313
## 2.0.6
414

515
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cuppachino/openapi-fetch",
33
"description": "An updated fork of ajaishankar's openapi-typescript-fetch",
4-
"version": "2.0.6",
4+
"version": "2.1.0",
55
"publishConfig": {
66
"access": "public"
77
},

src/index.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,17 @@ export type Fetch = (
9191
export type _TypedFetch<OP> = (
9292
arg: OpArgType<OP>,
9393
init?: RequestInit,
94-
) => Promise<ApiResponse<OpReturnType<OP>>>
95-
96-
export type _TypedFetchOptional<OP> =
97-
OpArgType<OP> extends Record<PropertyKey, never> ?
98-
(
99-
arg?: OpArgType<OP>,
100-
init?: RequestInit
101-
) => Promise<ApiResponse<OpReturnType<OP>>> : _TypedFetch<OP>
94+
) => Promise<ApiResponse<OpReturnType<OP>>>
95+
96+
export type _TypedFetchOptional<OP> = OpArgType<OP> extends Record<
97+
PropertyKey,
98+
never
99+
>
100+
? (
101+
arg?: OpArgType<OP>,
102+
init?: RequestInit,
103+
) => Promise<ApiResponse<OpReturnType<OP>>>
104+
: _TypedFetch<OP>
102105

103106
export type TypedFetch<OP> = _TypedFetchOptional<OP> & {
104107
Error: new (error: ApiError) => ApiError & {

0 commit comments

Comments
 (0)