@whitesev/utils 2.4.4 → 2.4.5

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.
@@ -1241,10 +1241,9 @@ export declare interface HttpxResponseData<T extends HttpxRequestOption> {
1241
1241
  /**
1242
1242
  * 响应内容,根据responseType,如果是html,那就是Document类型,如果是json,那么类型是Object类型
1243
1243
  */
1244
- // @ts-ignore
1245
- response: HttpxResponseTypeMap[T["responseType"]] extends unknown
1246
- ? HttpxResponseTypeMap["html"]
1247
- : T["responseType"];
1244
+ response: T["responseType"] extends keyof HttpxResponseTypeMap
1245
+ ? HttpxResponseTypeMap[T["responseType"]]
1246
+ : HttpxResponseTypeMap["html"];
1248
1247
  /**
1249
1248
  * 当请求头fetch为true时,该属性存在
1250
1249
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Httpx.ts CHANGED
@@ -1392,7 +1392,7 @@ class Httpx {
1392
1392
  * @param url 网址
1393
1393
  * @param details 配置
1394
1394
  */
1395
- post<T extends HttpxRequestOption>(
1395
+ post<T = HttpxRequestOption>(
1396
1396
  url: string,
1397
1397
  details: T // @ts-ignore
1398
1398
  ): HttpxPromise<HttpxResponse<T>>;
@@ -1241,10 +1241,9 @@ export declare interface HttpxResponseData<T extends HttpxRequestOption> {
1241
1241
  /**
1242
1242
  * 响应内容,根据responseType,如果是html,那就是Document类型,如果是json,那么类型是Object类型
1243
1243
  */
1244
- // @ts-ignore
1245
- response: HttpxResponseTypeMap[T["responseType"]] extends unknown
1246
- ? HttpxResponseTypeMap["html"]
1247
- : T["responseType"];
1244
+ response: T["responseType"] extends keyof HttpxResponseTypeMap
1245
+ ? HttpxResponseTypeMap[T["responseType"]]
1246
+ : HttpxResponseTypeMap["html"];
1248
1247
  /**
1249
1248
  * 当请求头fetch为true时,该属性存在
1250
1249
  */