@jayfong/x-request 2.82.0 → 2.83.1
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/lib/_cjs/index.js +2 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.js +2 -1
- package/package.json +1 -1
package/lib/_cjs/index.js
CHANGED
|
@@ -95,7 +95,8 @@ class XRequest {
|
|
|
95
95
|
rejectUnauthorized: false
|
|
96
96
|
},
|
|
97
97
|
isStream: responseType === 'stream',
|
|
98
|
-
throwHttpErrors: !options.noThrowHttpErrors
|
|
98
|
+
throwHttpErrors: !options.noThrowHttpErrors,
|
|
99
|
+
dnsCache: options.dnsCache
|
|
99
100
|
};
|
|
100
101
|
if (options.headers) {
|
|
101
102
|
gotOptions.headers = options.headers;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
2
|
import FormData from 'form-data';
|
|
3
3
|
import FormStream from 'formstream';
|
|
4
|
+
import { Options } from 'got';
|
|
4
5
|
import Request from 'got/dist/source/core';
|
|
5
6
|
import { CookieJar } from 'tough-cookie';
|
|
6
7
|
import { OmitStrict } from 'vtils/types';
|
|
@@ -86,6 +87,12 @@ export interface XRequestOptions {
|
|
|
86
87
|
* @default false
|
|
87
88
|
*/
|
|
88
89
|
autoTransformEncoding?: boolean | string;
|
|
90
|
+
/**
|
|
91
|
+
* DNS 缓存
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
dnsCache?: Options['dnsCache'];
|
|
89
96
|
}
|
|
90
97
|
export interface XRequestResponse<T> {
|
|
91
98
|
status: number;
|
package/lib/index.js
CHANGED
|
@@ -86,7 +86,8 @@ export class XRequest {
|
|
|
86
86
|
rejectUnauthorized: false
|
|
87
87
|
},
|
|
88
88
|
isStream: responseType === 'stream',
|
|
89
|
-
throwHttpErrors: !options.noThrowHttpErrors
|
|
89
|
+
throwHttpErrors: !options.noThrowHttpErrors,
|
|
90
|
+
dnsCache: options.dnsCache
|
|
90
91
|
};
|
|
91
92
|
if (options.headers) {
|
|
92
93
|
gotOptions.headers = options.headers;
|