url-options.ts
This file
Path
test-d/url-options.ts
8 lines · 328 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 withoutBaseUrl: Options = {baseUrl: undefined};const withoutPrefix: Options = {prefix: undefined};
expectTypeOf(withoutBaseUrl.baseUrl).toMatchTypeOf<Options['baseUrl']>();expectTypeOf(withoutPrefix.prefix).toMatchTypeOf<Options['prefix']>();