MCPcopy
hub / github.com/sindresorhus/got / timeout

Method timeout

source/core/options.ts:1765–1769  ·  view source on GitHub ↗

Milliseconds to wait for the server to end the response before aborting the request with `got.TimeoutError` error (a.k.a. `request` property). By default, there's no timeout. This also accepts an `object` with the following fields to constrain the duration of each phase of the request lifecycle:

()

Source from the content-addressed store, hash-verified

1763 - `request` starts when the request is initiated and ends when the response's end event fires.
1764 */
1765 get timeout(): Delays {
1766 // We always return `Delays` here.
1767 // It has to be `Delays | number`, otherwise TypeScript will error because the getter and the setter have incompatible types.
1768 return this.#internals.timeout;
1769 }
1770
1771 set timeout(value: Delays) {
1772 assertPlainObject('timeout', value);

Callers 3

cache.tsFile · 0.80
abort.tsFile · 0.80
timeout.tsFile · 0.80

Calls 3

assertPlainObjectFunction · 0.85
assertAnyFunction · 0.85
safeObjectAssignFunction · 0.85

Tested by

no test coverage detected