@aeriajs/common 0.0.64 → 0.0.66
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/http.js +1 -6
- package/dist/http.mjs +1 -6
- package/package.json +1 -1
package/dist/http.js
CHANGED
|
@@ -23,12 +23,7 @@ const defaultResponseTransformer = async (response) => {
|
|
|
23
23
|
const result = response;
|
|
24
24
|
result.data = await response.text();
|
|
25
25
|
if (response.headers.get('content-type')?.startsWith('application/json')) {
|
|
26
|
-
|
|
27
|
-
if (data.error && data.error instanceof Object) {
|
|
28
|
-
const error = new Error(data.error.message);
|
|
29
|
-
Object.assign(error, data.error);
|
|
30
|
-
throw error;
|
|
31
|
-
}
|
|
26
|
+
result.data = JSON.parse(result.data);
|
|
32
27
|
}
|
|
33
28
|
return result;
|
|
34
29
|
};
|
package/dist/http.mjs
CHANGED
|
@@ -17,12 +17,7 @@ export const defaultResponseTransformer = async (response) => {
|
|
|
17
17
|
const result = response;
|
|
18
18
|
result.data = await response.text();
|
|
19
19
|
if (response.headers.get("content-type")?.startsWith("application/json")) {
|
|
20
|
-
|
|
21
|
-
if (data.error && data.error instanceof Object) {
|
|
22
|
-
const error = new Error(data.error.message);
|
|
23
|
-
Object.assign(error, data.error);
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
20
|
+
result.data = JSON.parse(result.data);
|
|
26
21
|
}
|
|
27
22
|
return result;
|
|
28
23
|
};
|