@defjs/core 0.0.0-test-0003 → 0.0.0-test-0004
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 +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -294,7 +294,7 @@ async function doRequest(...args) {
|
|
|
294
294
|
const argsLength = args.length;
|
|
295
295
|
let ref;
|
|
296
296
|
let input;
|
|
297
|
-
let options
|
|
297
|
+
let options;
|
|
298
298
|
switch (argsLength) {
|
|
299
299
|
case 1: {
|
|
300
300
|
ref = args[0];
|
|
@@ -318,13 +318,13 @@ async function doRequest(...args) {
|
|
|
318
318
|
}
|
|
319
319
|
let abortController;
|
|
320
320
|
let abortSignal;
|
|
321
|
-
if (options
|
|
321
|
+
if (options?.abort) {
|
|
322
322
|
abortSignal = options.abort;
|
|
323
323
|
} else {
|
|
324
324
|
abortController = new AbortController;
|
|
325
325
|
abortSignal = abortController.signal;
|
|
326
326
|
}
|
|
327
|
-
const clientOptions = getClientConfig(options
|
|
327
|
+
const clientOptions = getClientConfig(options?.client || getGlobalClient());
|
|
328
328
|
const req = {
|
|
329
329
|
host: clientOptions?.host || "",
|
|
330
330
|
method: requestOptions.method,
|
|
@@ -335,12 +335,12 @@ async function doRequest(...args) {
|
|
|
335
335
|
responseType: requestOptions.responseType ?? "json",
|
|
336
336
|
context: requestOptions.context || makeHttpContext(),
|
|
337
337
|
observe: requestOptions.observe ?? "body",
|
|
338
|
-
uploadProgress: options
|
|
339
|
-
downloadProgress: options
|
|
340
|
-
timeout: options
|
|
338
|
+
uploadProgress: options?.uploadProgress,
|
|
339
|
+
downloadProgress: options?.downloadProgress,
|
|
340
|
+
timeout: options?.timeout || 0,
|
|
341
341
|
abort: abortSignal
|
|
342
342
|
};
|
|
343
|
-
const handler2 = options
|
|
343
|
+
const handler2 = options?.handler || clientOptions?.handler || getGlobalHttpHandler();
|
|
344
344
|
if (!handler2) {
|
|
345
345
|
throw new Error("no handler");
|
|
346
346
|
}
|