@kevisual/query 0.0.5 → 0.0.6
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.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -239,6 +239,7 @@ class Query {
|
|
|
239
239
|
const headers = { ...this.headers, ...options?.headers };
|
|
240
240
|
const adapter = options?.adapter || this.adapter;
|
|
241
241
|
const beforeRequest = options?.beforeRequest || this.beforeRequest;
|
|
242
|
+
const afterResponse = options?.afterResponse || this.afterResponse;
|
|
242
243
|
const timeout = options?.timeout || this.timeout;
|
|
243
244
|
const req = {
|
|
244
245
|
url: url,
|
|
@@ -251,8 +252,8 @@ class Query {
|
|
|
251
252
|
}
|
|
252
253
|
return adapter(req).then(async (res) => {
|
|
253
254
|
res.success = res.code === 200;
|
|
254
|
-
if (
|
|
255
|
-
return await
|
|
255
|
+
if (afterResponse) {
|
|
256
|
+
return await afterResponse(res);
|
|
256
257
|
}
|
|
257
258
|
return res;
|
|
258
259
|
});
|