Skip to content
Myr

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 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 withoutBaseUrl: Options = {baseUrl: undefined};5const withoutPrefix: Options = {prefix: undefined};67expectTypeOf(withoutBaseUrl.baseUrl).toMatchTypeOf<Options['baseUrl']>();8expectTypeOf(withoutPrefix.prefix).toMatchTypeOf<Options['prefix']>();