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
Support readonly inputs and explicit undefined in TypeScript optionsSindre Sorhusbefore adoption51b3177
lines 1–7why, one step back1import {expectTypeOf} from 'expect-type';2import type {Options, SearchParamsOption} from 'ky';34const searchParameters = [['tag', 'one'], ['tag', 'two'], ['page', 2], ['active', true]] as const;5const options: Options = {searchParams: searchParameters};67expectTypeOf(options.searchParams).toMatchTypeOf<SearchParamsOption>();