@apidevtools/json-schema-ref-parser 15.2.0 → 15.2.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.
|
@@ -106,7 +106,7 @@ async function download(u, httpOptions, _redirects) {
|
|
|
106
106
|
async function get(u, httpOptions) {
|
|
107
107
|
let controller;
|
|
108
108
|
let timeoutId;
|
|
109
|
-
if (httpOptions.timeout) {
|
|
109
|
+
if (httpOptions.timeout && typeof AbortController !== "undefined") {
|
|
110
110
|
controller = new AbortController();
|
|
111
111
|
timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
|
|
112
112
|
}
|
package/lib/resolvers/http.ts
CHANGED
|
@@ -121,7 +121,7 @@ async function download<S extends object = JSONSchema>(
|
|
|
121
121
|
async function get<S extends object = JSONSchema>(u: RequestInfo | URL, httpOptions: HTTPResolverOptions<S>) {
|
|
122
122
|
let controller: any;
|
|
123
123
|
let timeoutId: any;
|
|
124
|
-
if (httpOptions.timeout) {
|
|
124
|
+
if (httpOptions.timeout && typeof AbortController !== "undefined") {
|
|
125
125
|
controller = new AbortController();
|
|
126
126
|
timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
|
|
127
127
|
}
|