apigen-ts 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_template.ts +2 -1
- package/package.json +1 -1
package/dist/_template.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Use uppercase for names in ApiClient to avoid conflict with the generated code
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
3
4
|
namespace apigen {
|
|
4
5
|
export type Config = { baseUrl: string; headers: Record<string, string> }
|
|
5
6
|
export type Req = Omit<RequestInit, "body"> & {
|
|
@@ -69,7 +70,7 @@ export class ApiClient {
|
|
|
69
70
|
|
|
70
71
|
const credentials = opts.credentials ?? "include"
|
|
71
72
|
const rep = await fetch(url.toString(), { method, ...opts, headers, body, credentials })
|
|
72
|
-
if (!rep.ok) throw this.ParseError(rep)
|
|
73
|
+
if (!rep.ok) throw await this.ParseError(rep)
|
|
73
74
|
|
|
74
75
|
const rs = await rep.text()
|
|
75
76
|
try {
|