Comparing version
@@ -33,3 +33,3 @@ export const supportsRequestStreams = (() => { | ||
// The maximum value of a 32bit int (see issue #117) | ||
export const maxSafeTimeout = 2147483647; | ||
export const maxSafeTimeout = 2_147_483_647; | ||
export const stop = Symbol('stop'); | ||
@@ -64,3 +64,4 @@ export const kyOptionKeys = { | ||
duplex: true, | ||
priority: true, | ||
}; | ||
//# sourceMappingURL=constants.js.map |
@@ -107,5 +107,7 @@ import { HTTPError } from '../errors/HTTPError.js'; | ||
this._input = input; | ||
const isCredentialsSupported = 'credentials' in Request.prototype; | ||
const credentials = this._input instanceof Request && 'credentials' in Request.prototype | ||
? this._input.credentials | ||
: undefined; | ||
this._options = { | ||
credentials: isCredentialsSupported ? this._input.credentials : undefined, | ||
...(credentials && { credentials }), // For exactOptionalPropertyTypes | ||
...options, | ||
@@ -124,3 +126,3 @@ headers: mergeHeaders(this._input.headers, options.headers), | ||
throwHttpErrors: options.throwHttpErrors !== false, | ||
timeout: options.timeout ?? 10000, | ||
timeout: options.timeout ?? 10_000, | ||
fetch: options.fetch ?? globalThis.fetch.bind(globalThis), | ||
@@ -127,0 +129,0 @@ }; |
@@ -222,3 +222,2 @@ import type { LiteralUnion, Required } from './common.js'; | ||
prefixUrl: string; | ||
credentials?: Options['credentials']; | ||
}; | ||
@@ -230,3 +229,3 @@ /** | ||
method: NonNullable<RequestInit['method']>; | ||
credentials: RequestInit['credentials']; | ||
credentials?: NonNullable<RequestInit['credentials']>; | ||
retry: RetryOptions; | ||
@@ -233,0 +232,0 @@ prefixUrl: string; |
import type { KyHeadersInit, Options } from '../types/options.js'; | ||
export declare const validateAndMerge: (...sources: Array<Partial<Options> | undefined>) => Partial<Options>; | ||
export declare const mergeHeaders: (source1?: KyHeadersInit, source2?: KyHeadersInit) => Headers; | ||
export declare const deepMerge: <T>(...sources: (Partial<T> | undefined)[]) => T; | ||
export declare const deepMerge: <T>(...sources: Array<Partial<T> | undefined>) => T; |
{ | ||
"name": "ky", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Tiny and elegant HTTP client based on the browser Fetch API", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
144606
0.12%1136
0.18%