search-params.ts
This file
Path
test-d/search-params.ts
7 lines · 327 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, SearchParamsOption} from 'ky';
const searchParameters = [['tag', 'one'], ['tag', 'two'], ['page', 2], ['active', true]] as const;const options: Options = {searchParams: searchParameters};
expectTypeOf(options.searchParams).toMatchTypeOf<SearchParamsOption>();