@kevisual/query 0.0.23 → 0.0.24
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/query-browser.js +1 -28
- package/dist/query.js +1 -28
- package/package.json +1 -1
package/dist/query-browser.js
CHANGED
|
@@ -483,34 +483,7 @@ class Query {
|
|
|
483
483
|
...(_options?.headers || {}),
|
|
484
484
|
},
|
|
485
485
|
});
|
|
486
|
-
|
|
487
|
-
return wrapperError({
|
|
488
|
-
code: res.status,
|
|
489
|
-
message: `fetch error: ${res.statusText}`,
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
const contentType = res.headers.get('Content-Type');
|
|
493
|
-
if (contentType && contentType.includes('application/json')) {
|
|
494
|
-
const data = await res.json();
|
|
495
|
-
const result = { code: res.status, data, success: res.ok };
|
|
496
|
-
return setBaseResponse(result);
|
|
497
|
-
}
|
|
498
|
-
if (isTextForContentType(contentType)) {
|
|
499
|
-
const text = await res.text();
|
|
500
|
-
const result = {
|
|
501
|
-
code: res.status || 200,
|
|
502
|
-
data: text,
|
|
503
|
-
success: res.ok,
|
|
504
|
-
};
|
|
505
|
-
return setBaseResponse(result);
|
|
506
|
-
}
|
|
507
|
-
const blob = await res.blob();
|
|
508
|
-
const result = {
|
|
509
|
-
code: res.status,
|
|
510
|
-
data: blob,
|
|
511
|
-
success: res.ok,
|
|
512
|
-
};
|
|
513
|
-
return setBaseResponse(result);
|
|
486
|
+
return setBaseResponse(res);
|
|
514
487
|
}
|
|
515
488
|
}
|
|
516
489
|
class BaseQuery {
|
package/dist/query.js
CHANGED
|
@@ -267,34 +267,7 @@ class Query {
|
|
|
267
267
|
...(_options?.headers || {}),
|
|
268
268
|
},
|
|
269
269
|
});
|
|
270
|
-
|
|
271
|
-
return wrapperError({
|
|
272
|
-
code: res.status,
|
|
273
|
-
message: `fetch error: ${res.statusText}`,
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
const contentType = res.headers.get('Content-Type');
|
|
277
|
-
if (contentType && contentType.includes('application/json')) {
|
|
278
|
-
const data = await res.json();
|
|
279
|
-
const result = { code: res.status, data, success: res.ok };
|
|
280
|
-
return setBaseResponse(result);
|
|
281
|
-
}
|
|
282
|
-
if (isTextForContentType(contentType)) {
|
|
283
|
-
const text = await res.text();
|
|
284
|
-
const result = {
|
|
285
|
-
code: res.status || 200,
|
|
286
|
-
data: text,
|
|
287
|
-
success: res.ok,
|
|
288
|
-
};
|
|
289
|
-
return setBaseResponse(result);
|
|
290
|
-
}
|
|
291
|
-
const blob = await res.blob();
|
|
292
|
-
const result = {
|
|
293
|
-
code: res.status,
|
|
294
|
-
data: blob,
|
|
295
|
-
success: res.ok,
|
|
296
|
-
};
|
|
297
|
-
return setBaseResponse(result);
|
|
270
|
+
return setBaseResponse(res);
|
|
298
271
|
}
|
|
299
272
|
}
|
|
300
273
|
class BaseQuery {
|