Skip to content
Myr

timeout-options.ts

This file

Path

test-d/timeout-options.ts

8 lines · 358 bytes · TypeScript

Last changed by

Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177

History of this file

Take it

Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177

lines 1–8why, one step back
1import {expectTypeOf} from 'expect-type';
2import type {Options} from 'ky';34const defaultTimeout: Options = {timeout: undefined};5const withoutTotalTimeout: Options = {totalTimeout: undefined};67expectTypeOf(defaultTimeout.timeout).toMatchTypeOf<Options['timeout']>();8expectTypeOf(withoutTotalTimeout.totalTimeout).toMatchTypeOf<Options['totalTimeout']>();