revolt-api
Advanced tools
Comparing version
@@ -114,3 +114,7 @@ export * from "./types.js"; | ||
: JSON.stringify(body); | ||
const fetchdata = await fetch(new URL(`${path}?${query.toString()}`, config?.baseURL || this.baseURL).toString(), { | ||
let fetchpath = `${path}?${query.toString()}`; | ||
if (fetchpath.startsWith("/")) { | ||
fetchpath = (config?.baseURL || this.baseURL) + fetchpath; | ||
} | ||
const fetchdata = await fetch(new URL(fetchpath).toString(), { | ||
method, | ||
@@ -117,0 +121,0 @@ headers: { |
{ | ||
"name": "revolt-api", | ||
"version": "0.8.4-rc.3", | ||
"version": "0.8.4-rc.4", | ||
"description": "Revolt API Library", | ||
@@ -13,3 +13,3 @@ "type": "module", | ||
"devDependencies": { | ||
"@insertish/oapi": "0.2.0", | ||
"@insertish/oapi": "0.2.1", | ||
"in-publish": "^2.0.1", | ||
@@ -16,0 +16,0 @@ "openapi-typescript": "^5.4.2", |
@@ -194,16 +194,16 @@ // This file was auto-generated by @insertish/oapi! | ||
: JSON.stringify(body); | ||
const fetchdata = await fetch( | ||
new URL( | ||
`${path}?${query.toString()}`, | ||
config?.baseURL || this.baseURL | ||
).toString(), | ||
{ | ||
method, | ||
headers: { | ||
...(config?.headers || {}), | ||
...(this.config.headers || {}), | ||
} as HeadersInit, | ||
body: passbody, | ||
} | ||
); | ||
let fetchpath = `${path}?${query.toString()}`; | ||
if (fetchpath.startsWith("/")) { | ||
fetchpath = (config?.baseURL || this.baseURL) + fetchpath; | ||
} | ||
const fetchdata = await fetch(new URL(fetchpath).toString(), { | ||
method, | ||
headers: { | ||
...(config?.headers || {}), | ||
...(this.config.headers || {}), | ||
} as HeadersInit, | ||
body: passbody, | ||
}); | ||
return await fetchdata[config?.responseType || "json"](); | ||
@@ -210,0 +210,0 @@ } |
923707
0.02%24991
0.01%