Skip to content

Commit f21c05b

Browse files
authored
perf: remove unnecessary async keywords (#1809)
They simply increase code size (perf in this sense).
1 parent 224bf22 commit f21c05b

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.changeset/chilled-rules-judge.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": patch
3+
---
4+
5+
perf: remove unnecessary `async` keywords (for reduced code size)

packages/openapi-fetch/src/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -178,35 +178,35 @@ export default function createClient(clientOptions) {
178178

179179
return {
180180
/** Call a GET endpoint */
181-
async GET(url, init) {
181+
GET(url, init) {
182182
return coreFetch(url, { ...init, method: "GET" });
183183
},
184184
/** Call a PUT endpoint */
185-
async PUT(url, init) {
185+
PUT(url, init) {
186186
return coreFetch(url, { ...init, method: "PUT" });
187187
},
188188
/** Call a POST endpoint */
189-
async POST(url, init) {
189+
POST(url, init) {
190190
return coreFetch(url, { ...init, method: "POST" });
191191
},
192192
/** Call a DELETE endpoint */
193-
async DELETE(url, init) {
193+
DELETE(url, init) {
194194
return coreFetch(url, { ...init, method: "DELETE" });
195195
},
196196
/** Call a OPTIONS endpoint */
197-
async OPTIONS(url, init) {
197+
OPTIONS(url, init) {
198198
return coreFetch(url, { ...init, method: "OPTIONS" });
199199
},
200200
/** Call a HEAD endpoint */
201-
async HEAD(url, init) {
201+
HEAD(url, init) {
202202
return coreFetch(url, { ...init, method: "HEAD" });
203203
},
204204
/** Call a PATCH endpoint */
205-
async PATCH(url, init) {
205+
PATCH(url, init) {
206206
return coreFetch(url, { ...init, method: "PATCH" });
207207
},
208208
/** Call a TRACE endpoint */
209-
async TRACE(url, init) {
209+
TRACE(url, init) {
210210
return coreFetch(url, { ...init, method: "TRACE" });
211211
},
212212
/** Register middleware */

0 commit comments

Comments
 (0)