@hapaul/api 0.1.37 → 0.1.39
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/index.d.ts +1 -1
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -69,6 +69,11 @@ var Client = class {
|
|
|
69
69
|
if (contentType$1.includes("application/json")) assign(await response.json());
|
|
70
70
|
else if (contentType$1.includes("text/plain")) assign(await response.text());
|
|
71
71
|
else assign(await response.arrayBuffer());
|
|
72
|
+
const res = {
|
|
73
|
+
data,
|
|
74
|
+
error,
|
|
75
|
+
response
|
|
76
|
+
};
|
|
72
77
|
if (!isOk) {
|
|
73
78
|
let message = response.statusText;
|
|
74
79
|
if (typeof error === "object" && "message" in error) message = error.message;
|
|
@@ -76,12 +81,9 @@ var Client = class {
|
|
|
76
81
|
status,
|
|
77
82
|
message
|
|
78
83
|
});
|
|
84
|
+
return Promise.reject(res);
|
|
79
85
|
}
|
|
80
|
-
return
|
|
81
|
-
data,
|
|
82
|
-
error,
|
|
83
|
-
response
|
|
84
|
-
};
|
|
86
|
+
return res;
|
|
85
87
|
} catch (error) {
|
|
86
88
|
throw error;
|
|
87
89
|
}
|