headers.ts
This file
Path
test-d/headers.ts
7 lines · 264 bytes · TypeScript
Last changed by
Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177
History of this fileTake it
12345678import {expectTypeOf} from 'expect-type';import type {Options} from 'ky';
const headers = [['Accept', 'application/json'], ['X-Request-ID', '123']] as const;const options: Options = {headers};
expectTypeOf(options.headers).toMatchTypeOf<Options['headers']>();