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 fileTake it
123456789import {expectTypeOf} from 'expect-type';import type {Options} from 'ky';
const defaultTimeout: Options = {timeout: undefined};const withoutTotalTimeout: Options = {totalTimeout: undefined};
expectTypeOf(defaultTimeout.timeout).toMatchTypeOf<Options['timeout']>();expectTypeOf(withoutTotalTimeout.totalTimeout).toMatchTypeOf<Options['totalTimeout']>();