@@ -7,7 +7,15 @@ import {deepMerge, mergeHeaders} from '../utils/merge.js';
7
7
import { normalizeRequestMethod , normalizeRetryOptions } from '../utils/normalize.js' ;
8
8
import { delay , timeout , TimeoutOptions } from '../utils/time.js' ;
9
9
import { ObjectEntries } from '../utils/types.js' ;
10
- import { maxSafeTimeout , responseTypes , stop , supportsAbortController , supportsFormData , supportsStreams } from './constants.js' ;
10
+ import {
11
+ maxSafeTimeout ,
12
+ responseTypes ,
13
+ stop ,
14
+ supportsAbortController ,
15
+ supportsFormData ,
16
+ supportsResponseStreams ,
17
+ supportsRequestStreams ,
18
+ } from './constants.js' ;
11
19
12
20
export class Ky {
13
21
// eslint-disable-next-line @typescript-eslint/promise-function-async
@@ -56,7 +64,7 @@ export class Ky {
56
64
throw new TypeError ( 'The `onDownloadProgress` option must be a function' ) ;
57
65
}
58
66
59
- if ( ! supportsStreams ) {
67
+ if ( ! supportsResponseStreams ) {
60
68
throw new Error ( 'Streams are not supported in your environment. `ReadableStream` is missing.' ) ;
61
69
}
62
70
@@ -155,7 +163,7 @@ export class Ky {
155
163
156
164
this . request = new globalThis . Request ( this . _input as RequestInfo , this . _options as RequestInit ) ;
157
165
158
- if ( supportsStreams ) {
166
+ if ( supportsRequestStreams ) {
159
167
// @ts -expect-error - Types are outdated.
160
168
this . request . duplex = 'half' ;
161
169
}
0 commit comments